Unsafe flag with base template (#1279)

* unsafe flag with base template
dev
LuitelSamikshya 2021-11-27 17:10:27 -06:00 committed by GitHub
parent b59582bde7
commit b3805999f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -307,10 +307,12 @@ func (r *requestGenerator) fillRequest(req *http.Request, values map[string]inte
} }
req.Body = ioutil.NopCloser(strings.NewReader(body)) req.Body = ioutil.NopCloser(strings.NewReader(body))
} }
if !r.request.Unsafe {
setHeader(req, "User-Agent", uarand.GetRandom()) setHeader(req, "User-Agent", uarand.GetRandom())
}
// Only set these headers on non-raw requests // Only set these headers on non-raw requests
if len(r.request.Raw) == 0 { if len(r.request.Raw) == 0 && !r.request.Unsafe {
setHeader(req, "Accept", "*/*") setHeader(req, "Accept", "*/*")
setHeader(req, "Accept-Language", "en") setHeader(req, "Accept-Language", "en")
} }

View File

@ -312,7 +312,6 @@ func (request *Request) executeRequest(reqURL string, generatedRequest *generate
gologger.Print().Msgf("%s", dumpedRequestString) gologger.Print().Msgf("%s", dumpedRequestString)
} }
} }
var formedURL string var formedURL string
var hostname string var hostname string
timeStart := time.Now() timeStart := time.Now()