-
Notifications
You must be signed in to change notification settings - Fork 849
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
MM-14446: consider subpath when evaluating if url is internal #946
Conversation
When clicking on an URL with `target=_blank`, the webview decides if it should launch an external browser or a new window within the Electron application. Update this logic to consider the application's configured subpath so as to treat links outside the subpath but on the same domain as external.
test/specs/utils/util_test.js
Outdated
@@ -0,0 +1,48 @@ | |||
// Copyright (c) 2015-2016 Yuya Ochiai |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I admit I don't know the policy here, having just copied the license header from another file. Should I omit @yuya-oc's copyright on this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well he didn't write it. No idea why it's on the others. I think legally it's fine because the CLA doesn't sign over copyright just an indefinite license.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, now I know why:
/root/mattermost-desktop/test/specs/utils/util_test.js
3:1 error incorrect header header/header
Fixing this by making the header/header
rule apply to a hard-coded list of files, and going forward will only require the mattermost license on new files.
Adding HH for a second review before merge (as Yuya is not very available this month) |
Given customer urgency we'll take this for a v4.2 dot release |
I just left this as ready to merge since I don't know the process for merging this for a 4.2 dot release |
* MM-14446: consider subpath when evaluating if url is internal When clicking on an URL with `target=_blank`, the webview decides if it should launch an external browser or a new window within the Electron application. Update this logic to consider the application's configured subpath so as to treat links outside the subpath but on the same domain as external. * fix licensing on new file * fix .eslintrc.json indentation * tweak header eslint rules for specific files
* MM-14446: consider subpath when evaluating if url is internal When clicking on an URL with `target=_blank`, the webview decides if it should launch an external browser or a new window within the Electron application. Update this logic to consider the application's configured subpath so as to treat links outside the subpath but on the same domain as external. * fix licensing on new file * fix .eslintrc.json indentation * tweak header eslint rules for specific files
* MM-14446: consider subpath when evaluating if url is internal When clicking on an URL with `target=_blank`, the webview decides if it should launch an external browser or a new window within the Electron application. Update this logic to consider the application's configured subpath so as to treat links outside the subpath but on the same domain as external. * fix licensing on new file * fix .eslintrc.json indentation * tweak header eslint rules for specific files
…most#946) * MM-14446: consider subpath when evaluating if url is internal When clicking on an URL with `target=_blank`, the webview decides if it should launch an external browser or a new window within the Electron application. Update this logic to consider the application's configured subpath so as to treat links outside the subpath but on the same domain as external. * fix licensing on new file * fix .eslintrc.json indentation * tweak header eslint rules for specific files
Summary
When clicking on an URL with
target=_blank
, the webview decides if it should launch an external browser or a new window within the Electron application. Update this logic to consider the application's configured subpath so as to treat links outside the subpath but on the same domain as external.Issue link
https://mattermost.atlassian.net/browse/MM-14446
Test Cases
Added unit tests for helper function that tests if the target URL is internal. Tested with a subpath configured and without, verifying that links to different domains and different subpaths on the same domain are handled externally in the live build.