-
-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4812d61
commit 262afac
Showing
2 changed files
with
24 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
29 changes: 17 additions & 12 deletions
29
src/main/resources/static/templates/JWTVulnerability/LEVEL_13/HeaderInjection_Level13.js
This file contains 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 |
---|---|---|
@@ -1,18 +1,23 @@ | ||
function addEventListenerToSendHeaderButton() { | ||
document.getElementById("sendHeader").addEventListener("click", function() { | ||
const headerName = document.getElementById("headerName").value; | ||
const headerValue = document.getElementById("headerValue").value; | ||
document.getElementById("sendHeader").addEventListener("click", function () { | ||
const headerName = document.getElementById("headerName").value; | ||
const headerValue = document.getElementById("headerValue").value; | ||
|
||
let url = getUrlForVulnerabilityLevel(); | ||
let url = getUrlForVulnerabilityLevel(); | ||
|
||
doGetAjaxCall(function(data) { | ||
document.getElementById("headerResponse").innerHTML = data.isValid ? | ||
"Header Injection was successful!" : | ||
"Header Injection failed. Please try again."; | ||
}, url, true, { | ||
[headerName]: headerValue | ||
}); | ||
}); | ||
doGetAjaxCall( | ||
function (data) { | ||
document.getElementById("headerResponse").innerHTML = data.isValid | ||
? "Header Injection was successful!" | ||
: "Header Injection failed. Please try again."; | ||
}, | ||
url, | ||
true, | ||
{ | ||
[headerName]: headerValue, | ||
} | ||
); | ||
}); | ||
} | ||
|
||
addEventListenerToSendHeaderButton(); |