Skip to content

fix(cookie-picker): pass port explicitly to jsonResponse and errorResponse#33

Open
Jah-yee wants to merge 1 commit intogarrytan:mainfrom
Jah-yee:fix/cookie-picker-json-response-scope
Open

fix(cookie-picker): pass port explicitly to jsonResponse and errorResponse#33
Jah-yee wants to merge 1 commit intogarrytan:mainfrom
Jah-yee:fix/cookie-picker-json-response-scope

Conversation

@Jah-yee
Copy link

@Jah-yee Jah-yee commented Mar 13, 2026

Bug

The cookie picker API routes fail with ReferenceError: url is not defined because the jsonResponse() and errorResponse() helper functions reference url which is not in their scope - it only exists as a parameter in handleCookiePickerRoute().

Every API call (/cookie-picker/browsers, /domains, /import, /remove, /imported) throws ReferenceError.

Fix

Extract port at the top of handleCookiePickerRoute() and pass it explicitly to all jsonResponse() and errorResponse() calls.

Fixes #32

…ponse

The jsonResponse() and errorResponse() helper functions referenced 'url'
which was not in scope - it only exists in handleCookiePickerRoute().

This caused all API routes (/cookie-picker/browsers, /domains, /import,
/remove, /imported) to fail with 'ReferenceError: url is not defined'.

Fix: Extract port at the top of handleCookiePickerRoute() and pass it
explicitly to all jsonResponse() and errorResponse() calls.

Fixes garrytan#32
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.

fix(cookie-picker): jsonResponse references undefined url — all API routes return HTML error

1 participant