fix(common): Allow safeUrl for ngSrc in NgOptimizedImage#51351
Closed
atcastle wants to merge 1 commit intoangular:mainfrom
Closed
fix(common): Allow safeUrl for ngSrc in NgOptimizedImage#51351atcastle wants to merge 1 commit intoangular:mainfrom
atcastle wants to merge 1 commit intoangular:mainfrom
Conversation
d2f4cbe to
61c1d1a
Compare
packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts
Outdated
Show resolved
Hide resolved
packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts
Outdated
Show resolved
Hide resolved
packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts
Outdated
Show resolved
Hide resolved
61c1d1a to
a18c6dc
Compare
AndrewKushnir
approved these changes
Aug 15, 2023
Contributor
|
@atcastle thanks for addressing the feedback! The change looks great 👍 Could you please take a look at the failing |
a18c6dc to
b8f1db2
Compare
b8f1db2 to
8e1841a
Compare
Allow safeUrl and add transformer to immediately convert ngSrc to string
8e1841a to
70bcee7
Compare
jessicajaniuk
approved these changes
Aug 15, 2023
Contributor
jessicajaniuk
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
pkozlowski-opensource
approved these changes
Aug 16, 2023
Member
pkozlowski-opensource
left a comment
There was a problem hiding this comment.
LGTM
Reviewed-for: public-api
AndrewKushnir
approved these changes
Aug 16, 2023
Contributor
|
This PR was merged into the repository by commit d910bf8. |
AndrewKushnir
pushed a commit
that referenced
this pull request
Aug 17, 2023
Allow safeUrl and add transformer to immediately convert ngSrc to string PR Close #51351
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
Allow safeUrl and add transformer to immediately convert ngSrc to string PR Close angular#51351
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR makes a small change to NgOptimizedImage to properly allow inputs of the safeUrl type for ngSrc in NgOptimizedImage. This is purely for compatibility/migration concerns, as NgOptimizedImage does not enforce sanitization on the
srcurl, as that is not an xss vector in modern browsers.The change is made using a transform which automatically unwraps provided safeUrl values, so the rest of the NgOptimizedImage still treats the ngSrc as always being a string.
CC: @AndrewKushnir @kara