mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 15:03:32 +08:00
handle special case when browser also asks for favicon.ico
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@53 282b0af5-e82d-9cf1-ede4-77906d7719d0
This commit is contained in:
@@ -132,7 +132,9 @@ func parseURLPath(path string) (vid, fid, ext string) {
|
|||||||
sepIndex := strings.LastIndex(path, "/")
|
sepIndex := strings.LastIndex(path, "/")
|
||||||
commaIndex := strings.LastIndex(path[sepIndex:], ",")
|
commaIndex := strings.LastIndex(path[sepIndex:], ",")
|
||||||
if commaIndex <= 0 {
|
if commaIndex <= 0 {
|
||||||
|
if "favicon.ico" != path[sepIndex+1:] {
|
||||||
log.Println("unknown file id", path[sepIndex+1:])
|
log.Println("unknown file id", path[sepIndex+1:])
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dotIndex := strings.LastIndex(path[sepIndex:], ".")
|
dotIndex := strings.LastIndex(path[sepIndex:], ".")
|
||||||
|
@@ -7,8 +7,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
|
||||||
"pkg/util"
|
"pkg/util"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Needle struct {
|
type Needle struct {
|
||||||
@@ -47,7 +47,9 @@ func NewNeedle(r *http.Request) (n *Needle, e error) {
|
|||||||
func (n *Needle) ParsePath(fid string) {
|
func (n *Needle) ParsePath(fid string) {
|
||||||
length := len(fid)
|
length := len(fid)
|
||||||
if length <= 8 {
|
if length <= 8 {
|
||||||
|
if length > 0 {
|
||||||
log.Println("Invalid fid", fid, "length", length)
|
log.Println("Invalid fid", fid, "length", length)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
n.Key, n.Cookie = ParseKeyHash(fid)
|
n.Key, n.Cookie = ParseKeyHash(fid)
|
||||||
|
Reference in New Issue
Block a user