diff options
Diffstat (limited to '_www/target.ts')
| -rw-r--r-- | _www/target.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/_www/target.ts b/_www/target.ts index 26c15b2..9e637cc 100644 --- a/_www/target.ts +++ b/_www/target.ts @@ -9,6 +9,7 @@ import { loadTargetOptDuration, loadTargetOptRatePerSecond, loadTargetOptTimeout, + loadTargetHeader, loadTargetVar, } from "./functions.js"; import { @@ -90,6 +91,7 @@ export class Target { private generateContent(gorankusu: GorankusuInterface) { this.generateContentBaseURL(); this.generateContentAttackOptions(); + this.generateContentHeaders(); this.generateContentVars(); this.generateHTTPTargets(gorankusu); this.generateWebSocketTargets(gorankusu); @@ -179,6 +181,25 @@ export class Target { this.elContent.appendChild(wrapper); } + private generateContentHeaders() { + if (!this.opts.Headers) { + return; + } + + const wrapper = document.createElement("fieldset"); + + const legend = document.createElement("legend"); + legend.innerText = "Headers"; + wrapper.appendChild(legend); + + for (const [key, fi] of Object.entries(this.opts.Headers)) { + fi.value = loadTargetHeader(this.opts, key); + generateFormInput(wrapper, fi); + } + + this.elContent.appendChild(wrapper); + } + private generateContentVars() { if (!this.opts.Vars) { return; |
