ipfs / ipfs/kubo

HTTP API return 404 error in different format than other endpoints

Open
#3,468 4 comments 0 reactions 0 assignees View on GitHub
kind/bug P4 topic/api topic/rpc-api
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

#### Version information:

0.4.5-pre1.

#### Type:

Bug

#### Priority:

P3?

#### Description:

When the go-ipfs HTTP API is queried and an error occurs during the query, go-ipfs returns the error in format `{ Code: 500, Message: "Omg!" }` (JSON). However, when the requested endpoint is not found and a 404 is returned, the error is not in JSON but a string.

This is annoying because we have to handle 404 separately from other errors in js-ipfs-api. It'd be great if all errors were returned in the same format.

Perhaps set the content-type header for 404 to 'application/json'.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.