Browse Source

Don't panic if the passed url is empty

The proper way would be to return a 4xx error, but for now this
suffices.
Lucas Stadler 8 years ago
parent
commit
82bceba787
1 changed files with 2 additions and 2 deletions
  1. 2 2
      go/favicon/favicon.go

+ 2 - 2
go/favicon/favicon.go

@ -66,7 +66,7 @@ func main() {
66 66
func HandleProxy(w http.ResponseWriter, r *http.Request) {
67 67
	w.Header().Set("Cache-Control", "max-age=2419200")
68 68
69
	url := r.URL.Query()["url"][0]
69
	url := r.URL.Query().Get("url")
70 70
	favicon, err := GetFaviconCached(url)
71 71
	if err != nil {
72 72
		fmt.Printf("Error: '%s': %s\n", url, err)
@ -138,7 +138,7 @@ func GetImageCached(u string) ([]byte, string, error) {
138 138
}
139 139
140 140
func HandleGetFavicon(w http.ResponseWriter, r *http.Request) {
141
	url := r.URL.Query()["url"][0]
141
	url := r.URL.Query().Get("url")
142 142
	favicon, err := GetFaviconCached(url)
143 143
	if err != nil {
144 144
		fmt.Printf("Error: '%s': %s\n", url, err)