Search in sources :

Example 41 with HttpMalformedHeaderException

use of org.parosproxy.paros.network.HttpMalformedHeaderException in project zaproxy by zaproxy.

the class VariantHeaderUnitTest method createMessageWithHeaders.

private static HttpMessage createMessageWithHeaders(NameValuePair... headers) {
    HttpMessage message = new HttpMessage();
    try {
        StringBuilder requestHeaderBuilder = new StringBuilder("GET / HTTP/1.1\r\n");
        for (NameValuePair header : headers) {
            requestHeaderBuilder.append(header.getName());
            requestHeaderBuilder.append(": ");
            requestHeaderBuilder.append(header.getValue());
            requestHeaderBuilder.append("\r\n");
        }
        message.setRequestHeader(requestHeaderBuilder.toString());
    } catch (HttpMalformedHeaderException e) {
        throw new RuntimeException(e);
    }
    return message;
}
Also used : HttpMalformedHeaderException(org.parosproxy.paros.network.HttpMalformedHeaderException) HttpMessage(org.parosproxy.paros.network.HttpMessage)

Aggregations

HttpMalformedHeaderException (org.parosproxy.paros.network.HttpMalformedHeaderException)41 DatabaseException (org.parosproxy.paros.db.DatabaseException)24 HttpMessage (org.parosproxy.paros.network.HttpMessage)20 HistoryReference (org.parosproxy.paros.model.HistoryReference)10 IOException (java.io.IOException)8 URI (org.apache.commons.httpclient.URI)5 URIException (org.apache.commons.httpclient.URIException)5 RecordHistory (org.parosproxy.paros.db.RecordHistory)5 ApiException (org.zaproxy.zap.extension.api.ApiException)5 Matcher (java.util.regex.Matcher)4 ExtensionHistory (org.parosproxy.paros.extension.history.ExtensionHistory)4 Session (org.parosproxy.paros.model.Session)4 HttpRequestHeader (org.parosproxy.paros.network.HttpRequestHeader)4 InvalidMessageDataException (org.zaproxy.zap.extension.httppanel.InvalidMessageDataException)4 PatternSyntaxException (java.util.regex.PatternSyntaxException)3 TableHistory (org.parosproxy.paros.db.TableHistory)3 SiteNode (org.parosproxy.paros.model.SiteNode)3 SSLContextManager (ch.csnc.extension.httpclient.SSLContextManager)2 HarEntries (edu.umass.cs.benchlab.har.HarEntries)2 HarLog (edu.umass.cs.benchlab.har.HarLog)2