Commit Graph

37 Commits

Author SHA1 Message Date
AnasRazy /
65014d330a Fix off-by-one bug in HttpGetter.toByteArray()
What this PR does:
Fixes an off-by-one error in HttpGetter.toByteArray where responses of exactly maxBytes were being rejected.
Now allows responses up to maxBytes, and only throws if the response is larger.

Why this change is needed:
Some feeds return responses exactly equal to the limit.
Current implementation incorrectly throws an exception, breaking parsing.

How it works:
Reads up to maxBytes + 1 bytes.
If actual size exceeds maxBytes, throws exception.
Otherwise returns full content.

Other notes:
No breaking API changes.
Safe for existing usage.
2025-09-27 15:32:31 +05:30
Athou
3b8f62ff11 fix sonar warnings 2025-07-18 21:49:00 +02:00
Athou
0e96307726 ignore scheme case 2025-05-18 17:40:06 +02:00
flisk
c4ec249bc4 don't throw NotModifiedException on etag/lm changes
A well-behaved server should return 304 if our If-Modified-Since and If-None-Match indicate that we don't have the latest version of a resource cached. Having these extra conditions where we consider our local version fresh is not necessary, and may in fact lead to resource updates being missed when only one header changes.

We should instead trust the server to know whether it needs to send us a new resource or not based on the cache headers we provide.
2025-04-04 11:00:47 +02:00
Athou
fb7f041454 normalize line endings 2025-03-10 08:48:26 +01:00
Athou
c1305b56e3 insert jakarta imports where javax import were positioned 2025-03-02 11:37:06 +01:00
Athou
f519aa039f block local addresses to prevent SSRF attacks 2025-02-14 16:20:04 +01:00
Athou
8edd6a1e2d correctly handle 0 as a Retry-Header value (#1671) 2025-02-05 07:50:10 +01:00
Athou
c451eee406 fix(deps): update dependency org.apache.httpcomponents.client5:httpclient5 to v5.4.2
remove workaround that is no longer needed
2025-02-02 15:58:59 +01:00
Athou
37cf711cbc add support for the Retry-After header sent by OpenRSS 2025-01-27 07:48:19 +01:00
Athou
a073d843ab ignore invalid cache control values (#1619) 2024-12-02 18:43:46 +01:00
Athou
7a838cddad honor Cache-Control response header (#1615) 2024-11-29 17:06:57 +01:00
Athou
f3d2808f7d add support for Internationalized Domain Names (#1588) 2024-10-23 19:58:47 +02:00
Athou
99a02a2186 fix issue with some HTTP feeds (#1572) 2024-10-04 20:20:02 +02:00
Athou
21efffa345 Update dependency io.github.hakky54:sslcontext-kickstart-for-apache5 to v8.3.7
Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.4
2024-09-22 09:07:20 +02:00
Athou
8eefb1bcfb add http cache to avoid fetching feeds too often (#1431) 2024-09-14 14:00:15 +02:00
Athou
012ce71134 configurable http client timeouts 2024-08-16 21:16:02 +02:00
Athou
b333e8d90a set a timeout on ssl handshakes 2024-08-16 14:40:16 +02:00
Athou
cc32f8ad16 WIP 2024-08-13 12:48:37 +02:00
Athou
124983a396 rename metrics a little 2024-08-05 09:05:01 +02:00
Athou
43613688da evict unused HTTP connections 2024-08-05 08:41:12 +02:00
Athou
780b7666c5 add metrics for HttpGetter connection pool 2024-08-05 08:28:17 +02:00
Athou
b17a17ba10 don't parse feeds that are too large to prevent memory issues 2024-07-16 21:20:06 +02:00
Athou
24171faf86 fetchFeedInternal follows redirects, we don't need to call it twice (#1431) 2024-06-12 08:21:11 +02:00
Athou
9ede8d1c46 remove the Managed interface for classes that are not managed by dropwizard 2024-01-09 14:09:24 +01:00
Athou
b49d35f181 remove all remaining references to httpclient4 2023-12-26 08:21:35 +01:00
Athou
5ba248eaba update to httpclient5 2023-12-25 20:00:47 +01:00
Athou
11aff68052 java http client is unfortunately sometimes not honoring timeouts (https://bugs.openjdk.org/browse/JDK-8258397), use httpclient again 2023-12-25 17:15:33 +01:00
Athou
818d847607 CookieManager parses the cookie header even if we ask to ignore them, use our own cookie handler that does nothing 2023-12-22 22:27:42 +01:00
Athou
1db53e48c6 reduce connection keepalive timeout to 30s, default is 20 minutes 2023-12-22 20:22:00 +01:00
Athou
5601d150c3 restore the connect timeout feature 2023-12-22 16:10:34 +01:00
Athou
6c3895e60a make sure we ignore cookies 2023-12-18 15:39:11 +01:00
Athou
d9ccdf1caf use java standard http client because apache http clients should be reused because they support pooling but we don't need that 2023-12-18 11:53:14 +01:00
Athou
fd0e5426e5 upgrade to dropwizard 4.x 2023-12-17 15:10:57 +01:00
Athou
9c628a8f53 make each step of feed fetching return its own model 2023-05-01 09:58:19 +02:00
Athou
ea4b120a85 prevent full feed fetching next time we fetch it if caching header values changed but content did not (#1037) 2023-01-27 08:49:59 +01:00
Athou
ac7b6eeb21 split client and server into maven modules 2022-08-13 10:48:09 +02:00