Better name for no HTTP/0.9 #2022

Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
Greg Wilkins 2018-01-12 18:33:46 +01:00
parent de7e3001ef
commit c7e03d6175
4 changed files with 6 additions and 7 deletions

View File

@ -110,7 +110,7 @@ public enum HttpCompliance // TODO in Jetty-10 convert this enum to a class so t
case "RFC2616":
sections = EnumSet.complementOf(EnumSet.of(
HttpComplianceSection.NO_FIELD_FOLDING,
HttpComplianceSection.NO_HTTP_9));
HttpComplianceSection.NO_HTTP_0_9));
i++;
break;

View File

@ -28,8 +28,7 @@ public enum HttpComplianceSection
FIELD_NAME_CASE_INSENSITIVE("https://tools.ietf.org/html/rfc7230#section-3.2","Field name is case-insensitive"),
NO_WS_AFTER_FIELD_NAME("https://tools.ietf.org/html/rfc7230#section-3.2.4","Whitespace not allowed after field name"),
NO_FIELD_FOLDING("https://tools.ietf.org/html/rfc7230#section-3.2.4","No line Folding"),
NO_HTTP_9("https://tools.ietf.org/html/rfc7230#appendix-A.2","No HTTP/0.9"),
;
NO_HTTP_0_9("https://tools.ietf.org/html/rfc7230#appendix-A.2","No HTTP/0.9");
final String url;
final String description;

View File

@ -786,7 +786,7 @@ public class HttpParser
else if (b < HttpTokens.SPACE && b>=0)
{
// HTTP/0.9
if (complianceViolation(HttpComplianceSection.NO_HTTP_9,"No request version"))
if (complianceViolation(HttpComplianceSection.NO_HTTP_0_9,"No request version"))
throw new BadMessageException("HTTP/0.9 not supported");
handle=_requestHandler.startRequest(_methodString,_uri.toString(), HttpVersion.HTTP_0_9);
setState(State.END);
@ -853,7 +853,7 @@ public class HttpParser
else
{
// HTTP/0.9
if (complianceViolation(HttpComplianceSection.NO_HTTP_9,"No request version"))
if (complianceViolation(HttpComplianceSection.NO_HTTP_0_9,"No request version"))
throw new BadMessageException("HTTP/0.9 not supported");
handle=_requestHandler.startRequest(_methodString,_uri.toString(), HttpVersion.HTTP_0_9);

View File

@ -128,7 +128,7 @@ public class HttpParserTest
Assert.assertEquals("/999", _uriOrStatus);
Assert.assertEquals("HTTP/0.9", _versionOrReason);
Assert.assertEquals(-1, _headers);
Assert.assertThat(_complianceViolation, contains(HttpComplianceSection.NO_HTTP_9));
Assert.assertThat(_complianceViolation, contains(HttpComplianceSection.NO_HTTP_0_9));
}
@Test
@ -157,7 +157,7 @@ public class HttpParserTest
Assert.assertEquals("/222", _uriOrStatus);
Assert.assertEquals("HTTP/0.9", _versionOrReason);
Assert.assertEquals(-1, _headers);
Assert.assertThat(_complianceViolation, contains(HttpComplianceSection.NO_HTTP_9));
Assert.assertThat(_complianceViolation, contains(HttpComplianceSection.NO_HTTP_0_9));
}
@Test