File tree Expand file tree Collapse file tree
src/main/java/org/example Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ public ConnectionHandler(Socket client) {
2626 }
2727private List <Filter > buildFilters () {
2828 List <Filter > list = new ArrayList <>();
29+
30+ list .add (new org .example .filter .RateLimitingFilter ());
31+
2932 AppConfig config = ConfigLoader .get ();
3033 AppConfig .IpFilterConfig ipFilterConfig = config .ipFilter ();
3134 if (Boolean .TRUE .equals (ipFilterConfig .enabled ())) {
@@ -57,7 +60,8 @@ public void runConnectionHandler() throws IOException {
5760
5861 int statusCode = response .getStatusCode ();
5962 if (statusCode == HttpResponseBuilder .SC_FORBIDDEN ||
60- statusCode == HttpResponseBuilder .SC_BAD_REQUEST ) {
63+ statusCode == HttpResponseBuilder .SC_BAD_REQUEST ||
64+ statusCode == HttpResponseBuilder .SC_TOO_MANY_REQUESTS ) {
6165 byte [] responseBytes = response .build ();
6266 client .getOutputStream ().write (responseBytes );
6367 client .getOutputStream ().flush ();
You can’t perform that action at this time.
0 commit comments