TEZ-4742: AMWebController CORS: only reflect Origin when it matches configured Tez UI base URL#528
Merged
Merged
Conversation
|
💔 -1 overall
This message was automatically generated. |
Aggarwal-Raghav
force-pushed
the
TEZ-4742
branch
from
July 19, 2026 15:34
65fa487 to
44aca21
Compare
|
🎊 +1 overall
This message was automatically generated. |
Contributor
Author
|
CC @abstractdog , ready for review |
abstractdog
requested changes
Jul 21, 2026
Comment on lines
+140
to
147
| if (!historyUrlBase.isEmpty()) { | ||
| try { | ||
| URL url = URI.create(historyUrlBase).toURL(); | ||
| origin = url.getProtocol() + "://" + url.getAuthority(); | ||
| trustedOrigin = url.getProtocol() + "://" + url.getAuthority(); | ||
| } catch (IllegalArgumentException | MalformedURLException e) { | ||
| LOG.debug("Invalid url set for tez history url base: {}", historyUrlBase, e); | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
maybe refactor this to a method that derives the origin or returns null
abstractdog
reviewed
Jul 21, 2026
Comment on lines
+152
to
+153
| if (requestOrigin == null || requestOrigin.equals(trustedOrigin)) { | ||
| res.setHeader(ACCESS_CONTROL_ALLOW_ORIGIN, encodeHeader(trustedOrigin)); |
Contributor
There was a problem hiding this comment.
make a code comment above this for "educational purposes" regarding why we cannot reflect the request origin without checking the server's trusted origin, as this is the core of this fix
…onfigured Tez UI base URL
Aggarwal-Raghav
force-pushed
the
TEZ-4742
branch
from
July 21, 2026 10:12
44aca21 to
8f6d893
Compare
|
🎊 +1 overall
This message was automatically generated. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.