(req *fasthttp.Request, doPost bool, cb string, cookie map[string]string, prependCB bool)
| 109 | } |
| 110 | |
| 111 | func setRequest(req *fasthttp.Request, doPost bool, cb string, cookie map[string]string, prependCB bool) { |
| 112 | |
| 113 | cache := Config.Website.Cache |
| 114 | if cb != "" && cache.CBisParameter { |
| 115 | var newUrl string |
| 116 | newUrl, _ = addCachebusterParameter(req.URI().String(), cb, cache.CBName, prependCB) |
| 117 | |
| 118 | newURL, err := url.Parse(newUrl) |
| 119 | if err != nil { |
| 120 | msg := "Converting " + newUrl + " to URL:" + err.Error() + "\n" |
| 121 | Print(msg, Red) |
| 122 | } |
| 123 | req.SetRequestURI(newURL.String()) |
| 124 | req.UseHostHeader = true |
| 125 | } |
| 126 | |
| 127 | setRequestHeaders(req, cb) |
| 128 | setRequestCookies(req, cb, cookie) |
| 129 | |
| 130 | // Overwrite the content type if specified |
| 131 | if doPost { |
| 132 | if Config.ContentType != "" { |
| 133 | req.Header.SetContentType(Config.ContentType) |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | func responseCookiesToMap(resp *fasthttp.Response, cookieMap map[string]string) map[string]string { |
| 139 | resp.Header.VisitAllCookie(func(key, value []byte) { |
no test coverage detected