Browse Source

wrap etag value with double quotes

pull/15/head
Chris Lu 11 years ago
parent
commit
57a4549d86
  1. 2
      go/storage/crc.go
  2. 2
      go/weed/weed_server/volume_server_handlers.go

2
go/storage/crc.go

@ -25,5 +25,5 @@ func (c CRC) Value() uint32 {
func (n *Needle) Etag() string {
bits := make([]byte, 4)
util.Uint32toBytes(bits, uint32(n.Checksum))
return fmt.Sprintf("%x", bits)
return fmt.Sprintf("\"%x\"", bits)
}

2
go/weed/weed_server/volume_server_handlers.go

@ -95,7 +95,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
w.WriteHeader(http.StatusNotModified)
return
}
w.Header().Set("Etag", "\""+etag+"\"")
w.Header().Set("Etag", etag)
if n.NameSize > 0 && filename == "" {
filename = string(n.Name)
dotIndex := strings.LastIndex(filename, ".")

Loading…
Cancel
Save