Dear all:
in my localhost, it can display favicon.ico in the browser, when i upload
gae server, it can't show.
directory tree:
app.yaml
static
webapp
follow is my fiile content,
yaml:
- url: /favicon\.ico
static_files: static/images/favicon.ico
upload: static/images/favicon.ico
file.go:
func init() {
http.HandleFunc("/", root)
http.HandleFunc("/favicon.ico", favicon)
}
func favicon(w http.ResponseWriter, r *http.Request) {
favContent, _ := ioutil.ReadFile("static/images/favicon.ico")
w.Header().Set("Content-Type", "image/x-icon")
w.WriteHeader(200)
w.Write(favContent)
}
func root(w http.ResponseWriter, r *http.Request) {
//some code
}
$>curl -i http://domain/favicon.ico
HTTP/1.1 200 OK
Content-Type: image/x-icon
Date: Tue, 31 Jul 2012 09:39:30 GMT
Server: Google Frontend
Content-Length: 0
thx very much.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.