Add default block in DefaultHttpHeaders (#11329)

Motivation:

Every switch block should also have a default case.

Modification:

Add default block in DefaultHttpHeaders to ensure we not fall-through by mistake

Result:

Cleanup

Signed-off-by: xingrufei <xingrufei@sogou-inc.com>
This commit is contained in:
skyguard1 2021-05-28 14:47:53 +08:00 committed by Norman Maurer
parent cd4249218c
commit 02c3712067

View File

@ -464,6 +464,8 @@ public class DefaultHttpHeaders extends HttpHeaders {
throw new IllegalArgumentException("a header value contains a prohibited character '\\v': " + seq); throw new IllegalArgumentException("a header value contains a prohibited character '\\v': " + seq);
case '\f': case '\f':
throw new IllegalArgumentException("a header value contains a prohibited character '\\f': " + seq); throw new IllegalArgumentException("a header value contains a prohibited character '\\f': " + seq);
default:
break;
} }
} }
@ -475,6 +477,8 @@ public class DefaultHttpHeaders extends HttpHeaders {
return 1; return 1;
case '\n': case '\n':
return 2; return 2;
default:
break;
} }
break; break;
case 1: case 1:
@ -490,6 +494,8 @@ public class DefaultHttpHeaders extends HttpHeaders {
default: default:
throw new IllegalArgumentException("only ' ' and '\\t' are allowed after '\\n': " + seq); throw new IllegalArgumentException("only ' ' and '\\t' are allowed after '\\n': " + seq);
} }
default:
break;
} }
return state; return state;
} }