Repository navigation
api: 4xx JSON for historic queries, add robots.txt - #1313
Open
mikelberlin wants to merge 5 commits into
Open
mikelberlin wants to merge 5 commits into
mikelberlin wants to merge 5 commits into
Conversation
…of 500 foreignQuotation with a time before data exists hit SendError with a nil error (panic, 500); assetUpdates indexed an empty quotation slice (panic, 500). Both now return 404, and malformed params return 400. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
|
For reviewers: this PR turns panics on historic-param REST endpoints into 404/400 and keeps 500 for real backend errors. It also adds GET /robots.txt with Disallow: /. The last commit bumps cmd/http/restServer to diadata v1.4.714, as #1309 did. PR Validation creates the v1.4.714 release. Merging to master then builds and deploys the REST server through Production Deployment. 🤖 Generated with Claude Code |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Search Console 5xx on historic API queries.
/v1/foreignQuotation/:source/:symbol?time=before data exists (history starts 2023-07-20): the handler passed a nil error toSendError(panic, 500). Now 404 JSON. Non-numerictimenow 400.EUR-USDread asUSD-EUR) are unchanged: no history still returns 200 with zero values; a backend error returns 500./v1/assetUpdates/...?starttime=&endtime=with no quotations in range indexed an empty slice (panic, 500). Now 404 JSON. Bad numeric/time params and over-long ranges now 400.GET /robots.txton the API returnsUser-agent: */Disallow: /. The API is JSON only, nothing depends on crawling.Behaviour change to note
validateInputParams(path or query values containing special characters) now returns 400 instead of 500, on every endpoint that uses it. The error JSON shape is unchanged (errorcode,errormessage;errorcodenow reads 400).Tests
historic_test.gocovers: backend error -> 500, empty data -> 404, bad params -> 400, Yahoo reversed no-history -> 200, and the original panic URLs for both endpoints. The assetUpdates cases need a throwaway Redis (REDISURL) and are skipped without it; the packageinitalso needs Postgres withassetandblockchaintables.go vetandgofmtare clean.🤖 Generated with Claude Code