Add handling of static/ dir and URL parameters to server.go

static/ is required to load gerrit-theme.html.

URL parameters are important so that ?p2 is respected for Polymer 2.

Change-Id: I03dc6df95022ea3a13ed44b1903cdc5394772f32
This commit is contained in:
Ben Rohlfs
2019-06-29 10:29:45 +02:00
parent 287e860b82
commit e4a2c309b3

View File

@@ -74,6 +74,7 @@ func main() {
http.HandleFunc("/accounts/", handleProxy)
http.HandleFunc("/config/", handleProxy)
http.HandleFunc("/projects/", handleProxy)
http.HandleFunc("/static/", handleProxy)
http.HandleFunc("/accounts/self/detail", handleAccountDetail)
if len(*plugins) > 0 {
@@ -103,6 +104,7 @@ func handleIndex(writer http.ResponseWriter, originalRequest *http.Request) {
fakeRequest := &http.Request{
URL: &url.URL{
Path: "/",
RawQuery: originalRequest.URL.RawQuery,
},
}
handleProxy(writer, fakeRequest)