code: func parseRequestUrl(r *http.Request) string {
  	// Get url from custom x-api-request-url header
  	requestUrl := getOverrideHeader(r, DEFAULT_OVERRIDE_URL_HEADER, "")
  	if requestUrl != "" {
  		return strings.SplitN(requestUrl, "?", 2)[0]
  	}
  
  	// Get url from standard headers
  	requestUrl = getUrlFromStandardHeaders(r)
  	if requestUrl != "" {
  		return requestUrl
  	}
  
  	// Use incoming url
  	return fmt.Sprintf("http://%s%s", r.Host, r.URL.Path)
  }
docs: // Constructs the request URL based off of standard headers in the request, falling back to the HttpServletRequest.getRequestURL()
  // if the headers aren't available. Here is the ordered list of how we'll attempt to construct the URL:
  //  - x-api-request-url
  //  - x-forwarded-proto://x-forwarded-host:x-forwarded-port/HttpServletRequest.getRequestURI()
  //  - x-forwarded-proto://x-forwarded-host/HttpServletRequest.getRequestURI()
  //  - x-forwarded-proto://host:x-forwarded-port/HttpServletRequest.getRequestURI()
  //  - x-forwarded-proto://host/HttpServletRequest.getRequestURI() request.getRequestURL()
  //
  // Additional notes:
  //  - With x-api-request-url, the query string is passed, it will be dropped to match the other formats.
  //  - If the x-forwarded-host/host header has a port and x-forwarded-port has been passed, x-forwarded-port will be used.