Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseURL axios config property not used for isHTTP2Supported #9

Open
gotdibbs opened this issue Jul 22, 2024 · 0 comments
Open

BaseURL axios config property not used for isHTTP2Supported #9

gotdibbs opened this issue Jul 22, 2024 · 0 comments

Comments

@gotdibbs
Copy link

When the axios instance in use has a baseURL set, this isn't factored into the URL that this library uses to check if HTTP2 is supported. This seems to result in an error like:

{
  status: 'rejected',
  reason: TypeError [ERR_INVALID_URL]: Invalid URL
      at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
      at new NodeError (node:internal/errors:405:5)
      at new URL (node:internal/url:676:13)
      at isHTTP2Supported ([...]/node_modules/axios-http2-adapter/dist/adapter.js:51:17)
      [...]
    input: '/api/v1/[...]',
    code: 'ERR_INVALID_URL'
  }
}

Looking at the code, I would think this might be a one-liner of const url: URL = new URL(config.baseURL || config.url!); but don't know the axios internals all that well.

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

No branches or pull requests

1 participant