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(bug): #4015 #5621

Closed
wants to merge 1 commit into from
Closed

fix(bug): #4015 #5621

wants to merge 1 commit into from

Conversation

npiyush97
Copy link
Contributor

Describe your pull request here.

This PR closes #4105,
add new test and suggestion to discuss.

@npiyush97
Copy link
Contributor Author

@jasonsaayman need you view on this.
i fix previous pr problem and but there is still issue if we taking the case arguments are invalid.

if(!requestURL || !utils.isString(requestURL) && !((
Object.prototype.hasOwnProperty.call(requestURL, "protocol") &&
Object.prototype.hasOwnProperty.call(requestURL, "host")
)))
return true for ("//localhost:8000/")

so I thought to check URL aswell
with

function isurl(str){
let checkurl ;
try{
checkurl = new URL(str)
}
catch(err){
return false
}
return checkurl.protocol === "http:" || checkurl.protocol === "https:"
}

but this is having some test failed.
your thought ?

@npiyush97 npiyush97 closed this Sep 1, 2023
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?
1 participant