Categorygithub.com/guikcd/headerscheck
modulepackage
0.0.0-20240608170829-55e1a90fd256
Repository: https://github.com/guikcd/headerscheck.git
Documentation: pkg.go.dev

# README

Headerscheck

Actions Status

docker stars docker pulls docker automated build

Go Report Card License: GPL v3

Introduction

This is a simple tool in Go to make http requests and expect reponse codes, headers (or body). Please note that this tool is in fact my first Go program i've written only for discovering this language :)

Features

  • read config from yaml file
  • check http status codes
  • check multiples URLs (one at a time)
  • check if headers/values exists/not exists
  • check if body match or not a value
  • support regular expression in all values fields
  • don't follow redirects by default (to test them)
  • override default Go http client User-Agent and timeout
  • debug mode

Help

$ ./headerscheck -help
Usage of ./headerscheck:
  -config-file string
        Config file (default "config")
  -debug
        Enable debugging output
  -follow-redirect
        Follow redirect (http status codes 30X)
  -user-agent string
        User-Agent used for queries (default "Golang HeadersCheck/0.1 ([email protected])")

How to use

docker run --rm --volume $(pwd)/config.yml:/root/config.yml guidelacour/headerscheck

# Constants

UserAgent The http User-Agent used for testing.

# Structs

Configuration is the mapping of configs containing Scenario.
Scenario contain various resource to fetch and verify.