-
Notifications
You must be signed in to change notification settings - Fork 16
Enforce max length for user agent #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ Coverage Diff @@
## main #261 +/- ##
============================================
- Coverage 80.48% 80.46% -0.02%
- Complexity 1161 1162 +1
============================================
Files 102 102
Lines 4494 4500 +6
Branches 418 420 +2
============================================
+ Hits 3617 3621 +4
- Misses 681 682 +1
- Partials 196 197 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
I am curious about which situation this happens, where did this come from? |
| private static final String CACHE_CONFIG_MAX_SIZE = "maxSize"; | ||
| private static final int CACHE_MAX_SIZE_DEFAULT = 10000; | ||
| private static final String USER_AGENT_MAX_LENGTH_KEY = "user.agent.max.length"; | ||
| private static final int DEFAULT_USER_AGENT_MAX_LENGTH = 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about this number, it looks way too big, could you elaborate on why this number is reasonable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look at the test. We are getting user agent string close to 6k in length. That is the reason to bring in this limit. It is still very liberal. However the failure we had observed in prod environment with user agent of length ~6k is not there when user agent is truncated to length of 1000. Actually our code could handle user agent up to length of ~2.5k.
In case user agent length exceeds max length, the user agent is truncated to the configured max length