commit | b32b9ce48b02504885d5d800460c891360e44463 | [log] [tgz] |
---|---|---|
author | shaquilleq <shaqqywyan@gmail.com> | Tue Jun 02 13:58:27 2020 -0700 |
committer | Julie Qiu <julie@golang.org> | Wed Jun 03 21:19:29 2020 +0000 |
tree | 06f946208181fe5d214a75195ce01a3008429cb6 | |
parent | c44e1e4587ac45ab1782cfd71fdb66333cccd31a [diff] |
gddo-server: parse host and url from request correctly Most browsers send requests to http://godoc.org/net/http as GET /net/http HTTP/1.1 Host: godoc.org instead of as expected in current tests GET https://godoc.org/net/http HTTP/1.1 Host: godoc.org This causes http.Request.URL to have empty strings for the "Scheme" and "Host" fields (see https://golang.org/src/net/http/request.go#L120 and RFC 7230 Section 5.3). As a result, server logs show most gddoEvent structs as having an empty "Host" field and a relative path for the URL. This CL enables the parsing of these fields from the other fields of the http.Request struct. Change-Id: Iab923a0d9a70f32f36b6e4a15019afc648699796 Reviewed-on: https://go-review.googlesource.com/c/gddo/+/236143 Reviewed-by: Julie Qiu <julie@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com>