Commit 2a57a5c9 authored by Christopher Wedgwood's avatar Christopher Wedgwood Committed by Rob Pike

Trim space on input to make searching more robust.

R=rsc, r, gri
CC=golang-dev
https://golang.org/cl/186255
parent cd47c903
...@@ -1157,7 +1157,7 @@ type SearchResult struct { ...@@ -1157,7 +1157,7 @@ type SearchResult struct {
} }
func search(c *http.Conn, r *http.Request) { func search(c *http.Conn, r *http.Request) {
query := r.FormValue("q") query := strings.TrimSpace(r.FormValue("q"))
var result SearchResult var result SearchResult
if index, timestamp := searchIndex.get(); index != nil { if index, timestamp := searchIndex.get(); index != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment