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

fix: Resolving bug with relative baseURLs #46

Closed
wants to merge 1 commit into from
Closed

fix: Resolving bug with relative baseURLs #46

wants to merge 1 commit into from

Conversation

rschristian
Copy link

@rschristian rschristian commented Jul 23, 2020

What kind of change does this PR introduce?

A bugfix(?), perhaps feature expansion.

Did you add tests for your changes?

Yes, a test was added to cover relative baseURL's being used with Redaxios. Pretty much a copy/paste of the existing test but this time with a relative baseURL being used.

Summary

This PR fixes the issue I've outlined in #45. As it was, Redaxios constructed its URL, if a baseURL was provided, with new URL('/bar', '/foo');. However, /foo would not be a valid base URL and would cause an error if this was attempted.

I fixed this with simple string concatenation. I'm not sure if there was a reason to use the URL constructor, so forgive me if I'm missing something, but string concatenation should do the trick, be ever so slightly smaller, and expand Redaxios' feature set to include relative baseURLs.

Does this PR introduce a breaking change?

No breaking changes

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