mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-26 21:07:45 +08:00
fix(commands/http/handler) check if found
@mappum, could you CR this and let me know if I've interpreted the desired behavior correctly?
This commit is contained in:
parent
bff646fb26
commit
c46102cec5
@ -57,8 +57,8 @@ func (i Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set(streamHeader, "1")
|
||||
|
||||
} else {
|
||||
enc, err := req.Option(cmds.EncShort).String()
|
||||
if err != nil || len(enc) == 0 {
|
||||
enc, found, err := req.Option(cmds.EncShort).String()
|
||||
if err != nil || !found {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user