originalRequest returns a partial, shallow copy of req, including: req.Method, deep copy of req.URL (into the urlCopy parameter, which should be on the stack), req.RequestURI, and req.RemoteAddr. Notably, headers are not copied. This function is designed to be very fast and efficient, and useful pri
(req *http.Request, urlCopy *url.URL)
| 1013 | // be very fast and efficient, and useful primarily for |
| 1014 | // read-only/logging purposes. |
| 1015 | func originalRequest(req *http.Request, urlCopy *url.URL) http.Request { |
| 1016 | cloneURL(req.URL, urlCopy) |
| 1017 | return http.Request{ |
| 1018 | Method: req.Method, |
| 1019 | RemoteAddr: req.RemoteAddr, |
| 1020 | RequestURI: req.RequestURI, |
| 1021 | URL: urlCopy, |
| 1022 | } |
| 1023 | } |
| 1024 | |
| 1025 | // determineTrustedProxy parses the remote IP address of |
| 1026 | // the request, and determines (if the server configured it) |
no test coverage detected