BUGFIX: warning

This commit is contained in:
Jeroen De Meerleer 2021-05-31 09:48:09 +02:00
parent 784d60e368
commit 4eec21b3dd
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 4 additions and 4 deletions

View File

@ -108,14 +108,14 @@ class Job extends Repository
if(!empty($job['data']['vars'])) {
foreach($job['data']['vars'] as $key => $var) {
if (isset($job['data']['basicauth-username'])) $job['data']['basicauth-username'] = str_replace('{' . $key . '}', $var['value'], $job['data']['basicauth-username']);
if (!empty($job['data']['basicauth-username'])) $job['data']['basicauth-username'] = str_replace('{' . $key . '}', $var['value'], $job['data']['basicauth-username']);
$job['data']['url'] = str_replace('{' . $key . '}', $var['value'], $job['data']['url']);
}
}
$url = $job['data']['url'];
$options['http_errors'] = false;
$options['auth'] = isset($job['data']['basicauth-username']) ? [$job['data']['basicauth-username'], $job['data']['basicauth-password']] : NULL;
$options['auth'] = !empty($job['data']['basicauth-username']) ? [$job['data']['basicauth-username'], $job['data']['basicauth-password']] : NULL;
$res = $client->request('GET', $url, $options);
$return['exitcode'] = $res->getStatusCode();

View File

@ -134,8 +134,8 @@
</div>
<div class="mb-3">
<label for="response">Expected response status code</label>
<input type="text" name="response" class="form-control" id="response" placeholder="200">
<label for="http-status">Expected response status code</label>
<input type="text" name="http-status" class="form-control" id="http-status" placeholder="200">
</div>
</div>