parseMethod extracts the HTTP method from forwarded headers or the request itself.
(r *http.Request)
| 114 | |
| 115 | // parseMethod extracts the HTTP method from forwarded headers or the request itself. |
| 116 | func (p *Parser) parseMethod(r *http.Request) string { |
| 117 | if len(p.config.MethodHeaders) > 0 { |
| 118 | if method := getFirstHeader(r, p.config.MethodHeaders...); method != "" { |
| 119 | return method |
| 120 | } |
| 121 | } |
| 122 | return r.Method |
| 123 | } |
| 124 | |
| 125 | // parseURI extracts the URI from forwarded headers or the request itself. |
| 126 | func (p *Parser) parseURI(r *http.Request) string { |
no test coverage detected