use of org.zaproxy.zap.spider.filters.ParseFilter.FilterResult in project zaproxy by zaproxy.
the class DefaultParseFilterUnitTest method shouldNotFilterHttpMessageWithResponseUnderMaxParseSize.
@Test
void shouldNotFilterHttpMessageWithResponseUnderMaxParseSize() throws Exception {
// Given
int maxParseSizeBytes = 2;
DefaultParseFilter filter = new DefaultParseFilter(createSpiderParam(maxParseSizeBytes), resourceBundle);
HttpMessage httpMessage = createHttpMessageWithResponseBody("A");
// When
FilterResult filterResult = filter.filtered(httpMessage);
// Then
assertThat(filterResult.isFiltered(), is(equalTo(false)));
}
use of org.zaproxy.zap.spider.filters.ParseFilter.FilterResult in project zaproxy by zaproxy.
the class DefaultParseFilterUnitTest method shouldNotFilterHttpMessageWithRobotsTxtRequestEvenWithoutContentType.
@Test
void shouldNotFilterHttpMessageWithRobotsTxtRequestEvenWithoutContentType() throws Exception {
// Given
DefaultParseFilter filter = createDefaultParseFilter();
HttpMessage httpMessage = createHttpMessageWithRequestUri("/robots.txt");
httpMessage.getResponseHeader().setHeader(HttpHeader.CONTENT_TYPE, "");
// When
FilterResult filterResult = filter.filtered(httpMessage);
// Then
assertThat(filterResult.isFiltered(), is(equalTo(false)));
}
Aggregations