fix: wrong proof extension

This commit is contained in:
Derrick Hammer 2024-02-09 15:58:15 -05:00
parent a4afda0ecc
commit 227ac9b403
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 3 deletions

View File

@ -1348,9 +1348,9 @@ func (h *HttpHandler) DownloadFile(jc jape.Context) {
var hashBytes []byte
isProof := false
if strings.HasSuffix(cid, ".bao") {
if strings.HasSuffix(cid, ".obao") {
isProof = true
cid = strings.TrimSuffix(cid, ".bao")
cid = strings.TrimSuffix(cid, ".obao")
}
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")
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
}