Skip to content

Commit

Permalink
Added query_string flag
Browse files Browse the repository at this point in the history
Fixes #9
  • Loading branch information
PaulSec committed Aug 1, 2020
1 parent f63d1bc commit 4df366d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Each check needs those fields:
| headers | List of string | List of headers there should be in the HTTP response | Yes | N/A |
| match | List of string| List the strings there should be in the HTTP response | Yes | "[branch" |
| no_match | List of string | List the strings there should NOT be in the HTTP response | Yes | N/A |
| query_string | GET parameters that have to be passed to the endpoint | String | Yes | `query_string: "id=FOO-chopchoptest"` |
## External Libraries
Expand Down
8 changes: 6 additions & 2 deletions app/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ const (
type Config struct {
Insecure bool `yaml:"insecure"`
Plugins []struct {
URI string `yaml:"uri"`
Checks []struct {
URI string `yaml:"uri"`
QueryString string `yaml:"query_string"`
Checks []struct {
Match []*string `yaml:"match"`
AllMatch []*string `yaml:"all_match"`
StatusCode *int32 `yaml:"status_code"`
Expand Down Expand Up @@ -115,6 +116,9 @@ func Scan(cmd *cobra.Command, args []string) {
for index, plugin := range y.Plugins {
_ = index
tmpURL = prefix + urlList[i] + suffix + fmt.Sprint(plugin.URI)
if plugin.QueryString != "" {
tmpURL += "?" + plugin.QueryString
}
httpResponse, err := pkg.HTTPGet(insecure, tmpURL)
if err != nil {
_ = errors.Wrap(err, "Timeout of HTTP Request")
Expand Down

0 comments on commit 4df366d

Please sign in to comment.