Skip to content

Commit

Permalink
Handle the possibility of HTTP/0.9 with a better error message
Browse files Browse the repository at this point in the history
Motivation

RFC 1945 (see section 3.1) says that request lines may not have a version in which case the request is assumed to be HTTP/0.9. We don't necessarily want to support that but the existing Exception should indicate the possibility of the request being HTTP/0.9 and give the user a chance to track it down.

Modifications

Indicate in the Exception's message that the request is possibly HTTP/0.9.

Result

Fixes #6739
  • Loading branch information
Roger Kapsi authored and normanmaurer committed May 26, 2017
1 parent ca9d165 commit b419bd1
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -60,7 +60,7 @@ public static HttpVersion valueOf(String text) {
text = text.trim();

if (text.isEmpty()) {
throw new IllegalArgumentException("text is empty");
throw new IllegalArgumentException("text is empty (possibly HTTP/0.9)");
}

// Try to match without convert to uppercase first as this is what 99% of all clients
Expand Down

0 comments on commit b419bd1

Please sign in to comment.