Skip to content

feat(api): fetch accepts allowedDomains - #235

Open
kunwar-bot wants to merge 2 commits into
mainfrom
kunwarsodhi/fetch-allowed-domains-example
Open

kunwar-bot wants to merge 2 commits into
mainfrom
kunwarsodhi/fetch-allowed-domains-example

Conversation

@kunwar-bot

Copy link
Copy Markdown

Summary

Adds examples/fetch_allowed_domains.py: one fetch to a host on the allowedDomains list, and one to a host that isn't, which the API rejects with a 400 (BadRequestError).

allowedDomains reached this SDK in 7f374a2 (generated from browserbase/core#15896), but that commit's subject, api: forward fetch allowedDomains to fetch-api, isn't a conventional commit, so release-please doesn't count it. This PR's squash title, feat(api): fetch accepts allowedDomains, gives the next release its feature bump and changelog line.

Only examples/ changes; no generated code.

Testing

The API side is live in prod: allowedDomains on POST /v1/fetch returns 200 for an allowed host, 400 for a host outside the list, 400 for a redirect to a host outside the list, and 400 for a list over 1000 entries. This example, run from main against prod, printed Fetched 200 from example.com, then Blocked: ... host example.com is not in allowedDomains.

@kunwar-bot
kunwar-bot marked this pull request as ready for review November 25, 2026 18:01
@kunwar-bot
kunwar-bot requested a review from a team as a code owner November 25, 2026 18:01

@jordin jordin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. fetch_api.create(allowed_domains=...) and BadRequestError both exist in the generated client, from examples import bb matches the other examples, and the squash title gives release-please the feat that 7f374a2's subject missed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants