Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Commit

Permalink
Minor comment changes and move declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
codemanki committed Nov 28, 2019
1 parent 4703b1f commit 6b97077
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,11 @@ function onChallenge (options, response, body) {

let timeout = parseInt(options.cloudflareTimeout);
let match;
let hiddenInputName;

match = body.match(/name="(.+?)" value="(.+?)"/);

if (match) {
hiddenInputName = match[1];
let hiddenInputName = match[1];
payload[hiddenInputName] = match[2];
}

Expand Down Expand Up @@ -361,7 +360,7 @@ function onChallenge (options, response, body) {
match = body.match(/id="challenge-form" action="(.+?)" method="(.+?)"/);
if(match && match[2] && match[2] === 'POST') {
options.uri = uri.protocol + '//' + uri.host + match[1];
// Pass the payload using query string
// Pass the payload using body form
options.form = payload;
options.method = 'POST';
} else {
Expand All @@ -370,7 +369,7 @@ function onChallenge (options, response, body) {
// Pass the payload using query string
options.qs = payload;
}
//Decrement the number of challenges to solve.
// Decrement the number of challenges to solve.
options.challengesToSolve -= 1;
// baseUrl can't be used in conjunction with an absolute uri
if (options.baseUrl !== undefined) {
Expand Down

0 comments on commit 6b97077

Please sign in to comment.