Skip to content

Conversation

@crayonlu
Copy link

Fixes a bug where baseURL values that include trailing control/whitespace characters (e.g., \r) caused incorrect URL merging (the path was dropped and only query params remained). This change trims trailing whitespace from the provided base before joining paths and adds a regression test.

ofetch('/path', {
  baseURL: 'https://example.org/\r',
  query: { q: 'y' },
  onRequest: [({ request }) => console.log(request.toString())]
});

// wrong: https://example.org/?q=y
// expect: https://example.org/path?q=y

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