Skip to content

fix: repair a relative request URL instead of throwing - #20

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-9457-codex-relative-url
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-9457-codex-relative-url

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

withCodexContentTypeRepair called new URL() on the request URL with no base, so a relative URL (for example a mediated fetch's path) threw instead of reaching the backend.

Changes

  • The URL is parsed against a placeholder origin (new URL(url, "http://localhost").pathname); only its path is checked, as before.
  • Test (fails before the fix): a relative /backend-api/codex/responses URL is repaired.

Checks

bun run check, bun run build, bun run test:e2e (the live test skips without credentials) and the Node pack smoke pass locally.

Closes CL-9457

withCodexContentTypeRepair parsed the request URL with no base, so a relative URL such as a mediated fetch's path threw. It now resolves against a placeholder origin and only the pathname is checked.

Closes CL-9457
@TheGreatAxios
TheGreatAxios merged commit dca1b76 into main Sep 27, 2026
2 checks passed
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.

1 participant