-
Notifications
You must be signed in to change notification settings - Fork 2k
Simplify the DosFilter for #1256 #10748
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
Use only IP tracking for the DosFilter to fix #1256 Signed-off-by: gregw <[email protected]>
lorban
left a comment
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.
Just a few nits.
jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java
Outdated
Show resolved
Hide resolved
|
|
||
| // Sets the _prefix_ most significant bits to 1 | ||
| result[index] = (byte)~((1 << (8 - prefix)) - 1); | ||
| result[index] = (byte)-(1 << (8 - prefix)); |
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.
Any reason why you changed the bit manipulation? It looks correct, but it's always hard to review without tests.
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.
To keep intellij happy
Use only IP tracking for the DosFilter. Signed-off-by: gregw <[email protected]>
| Jetty places throttled requests in a priority queue, giving priority first to authenticated users and users with an HttpSession, then to connections identified by their IP addresses. | ||
| Connections with no way to identify them have lowest priority. | ||
| To uniquely identify authenticated users, you should implement the The extractUserId(ServletRequest request) function. | ||
| Jetty places throttled requests in a queue, and proceed only when there is capacity available. |
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.
This is the old documentation for Jetty 9.4.x, so leave it unchanged.
Use only IP tracking for the DosFilter to fix #1256 Signed-off-by: gregw <[email protected]>
Use only IP tracking for the DosFilter to fix #1256