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;
}
Aggregations