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.
(It is very important that you created an Apache Knox JIRA for this change and that the PR title/commit message includes the Apache Knox JIRA ID!)
What changes were proposed in this pull request?
This PR reimplements the
knoxauth.js
file using modern browser features. Additionally, it changes the jQuery functions back to native JavaScript functions for speed and complexity reasons, and removes the userAgent declaration, as it is never used.How was this patch tested?
This patch was tested manually via each function one at a time.
get("param") -> 'value' with ?param=value
testSameOrigin("https://some.other.site") -> false with https://some.safe.site
testSameOrigin("https://same.safe.site") -> true with https://some.safe.site
redirect("https://www.google.com") -> Redirection successful
unicodeBase64Encode("Hello World") -> 'SGVsbG8gV29ybGQ='
(Althoughunescape
andescape
are deprecated, I leftunescape
in the code)keypressed({keyCode:13}) -> login() called
login() with admin/password and ?originalUrl=TEST_ORIG_URL -> Redirection to redirecting.html?originalUrl=TEST_ORIG_URL
(Initially failure, see commit e417884)Please review Knox Contributing Process before opening a pull request.