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(helpers): gracefully handle invalid parameters in isURLSameOrigin #5123

Open
wants to merge 3 commits into
base: v1.x
Choose a base branch
from

Conversation

Tbhesswebber
Copy link

This PR closes #4105, first proving that the bug exists and then resolving it. The previous code seemed to have some expectation that a valid, non-string argument could be passed, which I left in place, only checking that the used properties exist if the provided argument is not a string.

@Tbhesswebber Tbhesswebber changed the title fix(helpers): gracefully handle unintentional strings in isURLSameOrigin fix(helpers): gracefully handle invalid parameters in isURLSameOrigin Oct 13, 2022
@jasonsaayman
Copy link
Member

@Tbhesswebber please check failed tests

@Tbhesswebber
Copy link
Author

@Tbhesswebber please check failed tests

@jasonsaayman - Should be fixed! Sorry about that - I was in a rush and didn't realize that my push of the fix failed before I made the PR

@@ -8,4 +8,17 @@
it('should detect different origin', function () {
expect(isURLSameOrigin('https://github.com/axios/axios')).toEqual(false);
});

it('should gracefully handle invalid arguments', () => {
const allFalse = [

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused variable allFalse.
@jasonsaayman
Copy link
Member

@Tbhesswebber still failing

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.

Maybe a bug in isURLSameOrigin function?
2 participants