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

Maybe a bug in isURLSameOrigin function? #4104

Closed
ghost opened this issue Sep 30, 2021 · 1 comment
Closed

Maybe a bug in isURLSameOrigin function? #4104

ghost opened this issue Sep 30, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 30, 2021

Describe the bug

There is probably a bug in

var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;

If you pass undefined, the parsed variable becomes undefined and then you try to access parsed.protocol. Of course I wouldn't pass undefined intentionally, but if I have some config object and property is missing, then you get this unexpected behavior in browser.

To Reproduce

const someConfigObject = {};
const opts = { url: someConfigObject.accidentallyNotExistingProperty };
axios(opts).then(response => console.log(response)).catch(e => console.log(e));

Expected behavior

At least error message saying that the url should be string, not undefined.

Environment

Additional context/Screenshots

...

@ghost ghost added the status:possible bug label Sep 30, 2021
@github-actions
Copy link
Contributor

Hello! 👋

This issue is being automatically closed because it does not follow the issue template. Please read the issue template carefully and follow all of the instructions when opening a new issue.

Thanks

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

0 participants