MCPcopy Create free account
hub / github.com/reugn/auth-server / parseMethod

Method parseMethod

internal/proxy/parser.go:116–123  ·  view source on GitHub ↗

parseMethod extracts the HTTP method from forwarded headers or the request itself.

(r *http.Request)

Source from the content-addressed store, hash-verified

114
115// parseMethod extracts the HTTP method from forwarded headers or the request itself.
116func (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.
126func (p *Parser) parseURI(r *http.Request) string {

Callers 1

ParseRequestDetailsMethod · 0.95

Calls 1

getFirstHeaderFunction · 0.85

Tested by

no test coverage detected