This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat($sanitize): Added support for the sftp protocol in $$ SanitizeUriProvider and linky filter #16102
Merged
Narretz
merged 7 commits into
angular:master
from
XFree:bugfix/1.6.X/add-support-sftp-protocol
Oct 11, 2017
Merged
feat($sanitize): Added support for the sftp protocol in $$ SanitizeUriProvider and linky filter #16102
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
edf903d
fix($$SanitizeUriProvider): added support for the sftp protocol in $$…
XFree 345a0ba
test(compileSpec): fix allow aHrefSanitizationWhitelist
XFree 47b5840
test($linkyFilter): add ftp and sftp tests
XFree 01a4871
docs(linky): add sftp protocol
XFree c818c77
chore(sanitizeSpec): remove unused var
XFree 1922577
chore($$SanitizeUriProvider): remove sftp from img Sanitization White…
XFree f35c17b
test(sanitizeUri): remove sftp test for img
XFree File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,9 @@ describe('sanitizeUri', function() { | |
testUrl = 'ftp://foo.com/bar'; | ||
expect(sanitizeImg(testUrl)).toBe('ftp://foo.com/bar'); | ||
|
||
testUrl = 'sftp://foo.com/bar'; | ||
expect(sanitizeImg(testUrl)).toBe('sftp://foo.com/bar'); | ||
|
||
testUrl = 'file:///foo/bar.html'; | ||
expect(sanitizeImg(testUrl)).toBe('file:///foo/bar.html'); | ||
}); | ||
|
@@ -216,6 +219,9 @@ describe('sanitizeUri', function() { | |
testUrl = 'ftp://foo/bar'; | ||
expect(sanitizeHref(testUrl)).toBe('ftp://foo/bar'); | ||
|
||
testUrl = 'sftp://foo/bar'; | ||
expect(sanitizeHref(testUrl)).toBe('sftp://foo/bar'); | ||
|
||
testUrl = 'mailto:[email protected]'; | ||
expect(sanitizeHref(testUrl)).toBe('mailto:[email protected]'); | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Oops, I missed this, sorry: is there a reason you're updating imgSrc too? I can see how navigational links could work, but if browsers don't support the protocol, images and such wouldn't work at all (Chrome seems to complain with
Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
at least).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'm fix it.