Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Servers return 200 OK when metadata isn't found #16

Closed
KtorZ opened this issue Jul 9, 2020 · 4 comments · Fixed by #17
Closed

Servers return 200 OK when metadata isn't found #16

KtorZ opened this issue Jul 9, 2020 · 4 comments · Fixed by #17

Comments

@KtorZ
Copy link
Contributor

KtorZ commented Jul 9, 2020

Testing on the version currently deployed for the shelley testnet:

$ curl -v https://smash.shelley-testnet.dev.cardano.org/api/v1/metadata/invalid
< HTTP/2 200 
< server: nginx
< date: Thu, 09 Jul 2020 14:04:01 GMT
< content-type: application/json;charset=utf-8
< vary: Accept-Encoding
{"code":"DbLookupTxMetadataHash","description":"The hash invalid is missing from the DB."}

This goes quite against one's intuition & REST practices in general. What about having the server returns a 404 so that clients can adjust their behavior based on the response's code.

@piotr-iohk
Copy link

Is this fix deployed to the shelley-testnet SMASH? I see that:

$ curl -v https://smash.shelley-testnet.dev.cardano.org/api/v1/metadata/invalid

< HTTP/2 200 
< server: nginx
< date: Wed, 15 Jul 2020 12:52:26 GMT
< content-type: application/json;charset=utf-8
< vary: Accept-Encoding

@ksaric
Copy link
Contributor

ksaric commented Jul 15, 2020

@piotr-iohk I would need confirmation from DevOps for that, but the redeploy is going to happen soon anyway (day or two away) so I can notify you when the redeploy is complete.

@ksaric
Copy link
Contributor

ksaric commented Jul 16, 2020

I can confirm this works locally, when the new version is deployed it will work.

@ksaric
Copy link
Contributor

ksaric commented Jul 16, 2020

@piotr-iohk The latest release (https://github.com/input-output-hk/smash/releases/tag/untagged-568b27b3771d5f884c30) contains the fix and will be deployed by DevOps. When that is complete, you will see the correct behavior.
Observe the "Sign off" table with "Ops" for confirmed deployment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants