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? #4105

Open
ghost opened this issue Sep 30, 2021 · 3 comments · May be fixed by #5123
Open

Maybe a bug in isURLSameOrigin function? #4105

ghost opened this issue Sep 30, 2021 · 3 comments · May be fixed by #5123
Labels
state::triage Issue that is awaiting trial

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
@ghost
Copy link
Author

ghost commented Sep 30, 2021

I recreated this issue, because it was missing some heading and bot closed it. I added the missing header.

@omriLugasi
Copy link

I would like to work on a solution for that, any objections?

@ghost
Copy link
Author

ghost commented Jan 13, 2022

@omriLugasi No objections, have you done anything yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state::triage Issue that is awaiting trial
Projects
None yet
2 participants