IAuthMethodHttpMacro authMethodMacro = (IAuthMethodHttpMacro)authMethod;
IHttpMacroContext context = scan.getRequestEngine().createMacroContext();
context.setDict(identity.getDict());
IHttpMacroExecutor executor = scan.getRequestEngine().createMacroExecutor(authMethodMacro.getMacro(), context);
while (executor.hasNext()) {
IHttpResponse response;
int status;
try {
response = executor.sendNextRequest().get(true);
} catch (Exception e) {
logger.log(Level.WARNING, e.getMessage());
return false;
}
contentAnalyzer.processResponse(response, true, false);
status = response.getResponseCode();
if (status == 301 || status == 302 || status == 303 || status == 307) {
Header locationHeader = response.getRawResponse().getFirstHeader("Location");
if (locationHeader == null) {
return false;
}
else {
final VegaURI base = VegaURI.fromHostAndRequest(response.getHost(), response.getOriginalRequest());
final VegaURI uri = base.resolve(locationHeader.getValue());
if (uriFilter.filter(uri)) {
uriParser.processUri(uri);
}
}