aboutsummaryrefslogtreecommitdiff
path: root/internal/frontend/server.go
diff options
context:
space:
mode:
authorJamal Carvalho <jamal@golang.org>2022-10-17 16:49:27 +0000
committerJamal Carvalho <jamal@golang.org>2022-10-19 15:15:06 +0000
commit98a9857bdef7b04176071ced9df71696cd7bf0a2 (patch)
tree0a1d2e181d41d692b7ca5d94f5eb57b2077bb24f /internal/frontend/server.go
parent9b04e6a23080dc2cb1159b4666d1a3c886774001 (diff)
downloadgo-x-pkgsite-98a9857bdef7b04176071ced9df71696cd7bf0a2.tar.xz
internal/frontend: use frontend.searchMode to determine route tag
The search mode is detected automatically when it is not set by the client. This ensures that all searches are correctly tagged when coming from the homepage where the mode is not explictly set. Change-Id: I89954e890175de8cff7be2e8ef773d565c6b845c Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/443338 Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Diffstat (limited to 'internal/frontend/server.go')
-rw-r--r--internal/frontend/server.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/internal/frontend/server.go b/internal/frontend/server.go
index bef46c4f..5ba2ae9d 100644
--- a/internal/frontend/server.go
+++ b/internal/frontend/server.go
@@ -381,11 +381,7 @@ func TagRoute(route string, r *http.Request) string {
}
}
if tag == "search" {
- switch m := r.URL.Query().Get("m"); m {
- case "symbol", "package", "vuln":
- fmt.Println(tag, m)
- tag += "-" + m
- }
+ tag += "-" + searchMode(r)
}
return tag
}