fix: restore non-fatal BotID checks#30
Draft
cursor[bot] wants to merge 1 commit intomainfrom
Draft
Conversation
Restore the Vercel-only BotID guard and catch BotID lookup failures in\nboth POST routes. This prevents missing x-vercel-oidc-token headers\nfrom crashing legitimate follow-up and chat requests after the\nsimplified BotID check reintroduced the original failure mode.\n\nFixes WEBVITALS-3K\nCo-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Sergiy Dybskiy <s@serg.tech>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Description
Fixes a regression in WEBVITALS-3K.
checkBotId()was called unconditionally in both protected POST routes. When the BotID request arrived without thex-vercel-oidc-tokenheader, the BotID library threw before either handler could continue or return a controlled response.9fd107e(simplify botid check) removed the Vercel-only guard and the exception handling that had been introduced by PR Improve robustness of BotID check by handling exceptions #9 / merge commit5f16250ac3adf63eb8918b40465ebf8ca9c0dd7f./api/chatand/api/follow-up-suggestions, allowing legitimate requests to proceed when verification headers are missing while still blocking confirmed bots.Sentry Context
3dad06a481817bc715ba83934de828125c64fb2c5f16250ac3adf63eb8918b40465ebf8ca9c0dd7fType of Change
Verification
pnpm devserver started successfully in automation.POST /api/follow-up-suggestionsreturned HTTP 200 locally instead of throwing the missingx-vercel-oidc-tokenerror.POST /api/chatreturned HTTP 200 locally and completed its streamed response.Checklist
pnpm check-types)pnpm lint) — blocked by pre-existing repository-wide Biome findings unrelated to this patchTest plan