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 GitHub
parent 83290c5a4b
commit cfe631ad05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -475,6 +475,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;
} }
} }
@ -486,6 +488,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:
@ -501,6 +505,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;
} }