fix: wrong proof extension
This commit is contained in:
parent
a4afda0ecc
commit
227ac9b403
|
@ -1348,9 +1348,9 @@ func (h *HttpHandler) DownloadFile(jc jape.Context) {
|
||||||
var hashBytes []byte
|
var hashBytes []byte
|
||||||
isProof := false
|
isProof := false
|
||||||
|
|
||||||
if strings.HasSuffix(cid, ".bao") {
|
if strings.HasSuffix(cid, ".obao") {
|
||||||
isProof = true
|
isProof = true
|
||||||
cid = strings.TrimSuffix(cid, ".bao")
|
cid = strings.TrimSuffix(cid, ".obao")
|
||||||
}
|
}
|
||||||
|
|
||||||
cidDecoded, err := encoding.CIDFromString(cid)
|
cidDecoded, err := encoding.CIDFromString(cid)
|
||||||
|
@ -1389,7 +1389,7 @@ func (h *HttpHandler) DownloadFile(jc jape.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
jc.ResponseWriter.Header().Set("Content-Type", "application/octet-stream")
|
jc.ResponseWriter.Header().Set("Content-Type", "application/octet-stream")
|
||||||
http.ServeContent(jc.ResponseWriter, jc.Request, fmt.Sprintf("%.bao", file.Name()), file.Modtime(), bytes.NewReader(proof))
|
http.ServeContent(jc.ResponseWriter, jc.Request, fmt.Sprintf("%.obao", file.Name()), file.Modtime(), bytes.NewReader(proof))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue