use of org.parosproxy.paros.network.HttpRequestHeader in project zaproxy by zaproxy.
the class SpiderScan method readURI.
@Override
public void readURI(HttpMessage msg) {
HttpRequestHeader requestHeader = msg.getRequestHeader();
HttpResponseHeader responseHeader = msg.getResponseHeader();
resourcesFound.add(new SpiderResource(msg.getHistoryRef().getHistoryId(), requestHeader.getMethod(), requestHeader.getURI().toString(), responseHeader.getStatusCode(), responseHeader.getReasonPhrase()));
if (View.isInitialised()) {
addMessageToMessagesTableModel(msg);
}
}
use of org.parosproxy.paros.network.HttpRequestHeader in project zaproxy by zaproxy.
the class FilterLogPostQuery method onHttpRequestSend.
@Override
public void onHttpRequestSend(HttpMessage httpMessage) {
HttpRequestHeader reqHeader = httpMessage.getRequestHeader();
if (reqHeader != null && reqHeader.isText() && !reqHeader.isImage()) {
if (reqHeader.getMethod().equalsIgnoreCase(HttpRequestHeader.POST)) {
try {
URI uri = reqHeader.getURI();
// ZAP: Removed unused variable (int pos).
String firstline;
URI newURI = (URI) uri.clone();
String query = httpMessage.getRequestBody().toString();
if (query != null) {
newURI.setQuery(null);
firstline = newURI.toString();
// ZAP: Added type arguments.
Hashtable<String, String> param = parseParameter(query);
writeLogFile(firstline, param);
} else {
firstline = uri.toString();
writeLogFile(firstline, null);
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
}
}
use of org.parosproxy.paros.network.HttpRequestHeader in project zaproxy by zaproxy.
the class DefaultParseFilterUnitTest method createHttpMessageWithRequestUri.
private static HttpMessage createHttpMessageWithRequestUri(String requestUri) {
try {
HttpMessage message = new HttpMessage(new HttpRequestHeader("GET " + requestUri + " HTTP/1.1\r\nHost: example.com\r\n"));
message.setResponseHeader("HTTP/1.1 200 OK\r\n");
return message;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of org.parosproxy.paros.network.HttpRequestHeader in project zaproxy by zaproxy.
the class AuthenticationMethodIndicatorsUnitTest method setUp.
@BeforeEach
void setUp() throws Exception {
loginMessage = new HttpMessage();
HttpRequestHeader header = new HttpRequestHeader();
header.setURI(new URI("http://www.example.com", true));
loginMessage.setRequestHeader(header);
method = Mockito.mock(AuthenticationMethod.class, Mockito.CALLS_REAL_METHODS);
method.setAuthCheckingStrategy(AuthCheckingStrategy.EACH_RESP);
}
use of org.parosproxy.paros.network.HttpRequestHeader in project zaproxy by zaproxy.
the class AuthenticationMethodPollUrlUnitTest method setUp.
@BeforeEach
void setUp() throws Exception {
loginMessage = new HttpMessage();
HttpRequestHeader header = new HttpRequestHeader();
header.setURI(new URI("http://www.example.com", true));
loginMessage.setRequestHeader(header);
method = Mockito.mock(AuthenticationMethod.class, Mockito.CALLS_REAL_METHODS);
method.setAuthCheckingStrategy(AuthCheckingStrategy.EACH_RESP);
this.startServer();
}
Aggregations