Commit graph

87 commits

Author SHA1 Message Date
Raphael Gradenwitz
510c203dfe
Merge branch 'master' into ernolf/enh/http2-brotli-client
Signed-off-by: Raphael Gradenwitz <39901936+ernolf@users.noreply.github.com>
2026-01-08 21:02:07 +01:00
Christoph Wurst
adf7ea5f0b perf: log slow DNS operations
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2026-01-08 11:22:15 +01:00
provokateurin
0c3a872908
feat(CertificateManager): Add option to specify the default certificates bundle path
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-12-01 10:47:23 +01:00
Marcel Müller
b91034b3cf chore: Add server version to default crawler user agent
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
2025-11-07 11:20:56 +01:00
ernolf
b6ea2bc0f5
refactor(http-client): use direct HTTP/2 cURL hint and align tests
Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>
2025-10-22 12:17:17 +02:00
ernolf
812f12ecc4
perf(client): enable HTTP/2 and brotli support in internal HTTP client
- Prefer HTTP/2 by setting RequestOptions::VERSION => "2.0" so clients
  that respect PSR-7 request version will prefer HTTP/2.
- Add a curl hint (CURLOPT_HTTP_VERSION) to prefer HTTP/2 via ALPN
  (CURL_HTTP_VERSION_2TLS or CURL_HTTP_VERSION_2_0 fallback) while allowing
  automatic fallback to HTTP/1.1.
- Advertise Brotli ("br") in Accept-Encoding when the php-brotli extension
  is available (detected via function_exists('brotli_uncompress')), otherwise
  fall back to gzip.

Notes:
- The PSR-7 request version is used as a hint for HTTP client libraries;
  setting the version to "2.0" signals a preference for HTTP/2 at the request
  abstraction level.
- The curl option is defensive: it prefers HTTP/2 where libcurl supports it
  (via ALPN), but will not break on older libcurl/builds (uses defined()).

Compatibility:
- Fully backwards compatible: if the php-brotli extension is not present,
  no Brotli usage will occur and behaviour remains equivalent to previous
  (gzip).

Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>
2025-09-30 17:01:07 +02:00
Ferdinand Thiessen
5b96cca038 chore(Http\Client): fix linting issues
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-07-09 14:42:58 +02:00
Ferdinand Thiessen
5981b7eb51
chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +02:00
Daniel Kesselberg
3d0fb7e603
docs(http): Update return type for getBody
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2025-06-30 11:50:10 +02:00
georglauterbach
4d517a33ba
fix: remove superflous line
Signed-off-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com>
2024-11-09 11:56:19 +01:00
georglauterbach
387cd8b771
fix: do not query CNAME if A succeeded already
Signed-off-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com>
2024-11-06 20:21:38 +01:00
Thomas Citharel
dcd27fd986
feat(http-client): expose default request timeout constant to be used instead of magic number 30
Will be used to set default where we are able to override the default timeout.

See https://github.com/nextcloud/server/pull/48418

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-10-11 10:57:02 +02:00
Daniel Kesselberg
6be00432b7
chore: always execute parse_url in preventLocalAddress
This change should make it easier to spot wrong uses of the HTTP client on development setups where allow_local_remote_servers is usually true.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-10-01 18:00:47 +02:00
provokateurin
9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +02:00
Daniel Kesselberg
af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02:00
Andy Scherzinger
dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00
Benjamin Gaussorgues
7e4be1fcfd
fix(dns): detect disabled IPv6 support in DNS pinning
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2024-03-26 12:04:51 +01:00
John Molakvoæ
836c882b8c
Merge pull request #43446 from jithin-space/add-patch-request-to-http-client-interface 2024-03-16 13:21:13 +01:00
Côme Chilliet
82fbab4632 fix: Swap method and uri parameter in request to match upstream order
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-03-07 14:06:08 +01:00
Ferdinand Thiessen
01d5af66be feat(IClient): Add request function to do arbitrary HTTP requests
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-03-07 14:06:08 +01:00
Joas Schilling
ecb111cec7
fix(federation): Allow cloud federation providers to handle unsuccessful return codes
Otherwise they are put to retry and will immediately trigger bruteforce protection infinitely

Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-02-28 10:20:55 +01:00
Robin Kluth
414f8f1f2d Include hostName:$port for Host access violation message as well
Signed-off-by: Robin Kluth <Commifreak@users.noreply.github.com>
2024-02-24 11:34:34 +01:00
Robin Kluth
25c0021137 Log Host/IP in LocalServerException for Host violates local access rules
Signed-off-by: Robin Kluth <Commifreak@users.noreply.github.com>
2024-02-24 11:34:34 +01:00
Robin Kluth
d70cd5add2 Log Host/IP in LocalServerException for Host violates local access rules
Signed-off-by: Robin Kluth <Commifreak@users.noreply.github.com>
2024-02-24 11:34:34 +01:00
jithin-space
7c11414c9b added patch method
Signed-off-by: jithin-space <jithin.thankachan@gpsrenewables.com>
2024-02-08 15:54:20 +05:30
Daniel Kesselberg
f8f985602b
test: add tests for dns pin middleware
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-09-12 14:04:23 +02:00
Daniel Kesselberg
03f1f1ed2e
enh: skip processing for empty response
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-09-04 15:28:02 +02:00
Daniel Kesselberg
eab46bdfe6
feat: add switch to disable dns pinning
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-08-29 18:03:54 +02:00
Joas Schilling
ec6728d710
feat(HTTPClient): Provide wrapped access to Guzzle's asyncRequest()
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-06-27 15:53:57 +02:00
Robin Appelman
e7ab30f5d8
log performance events for http requests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-28 15:37:57 +02:00
Côme Chilliet
426c0341ff
Use typed version of IConfig::getSystemValue as much as possible
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 12:50:08 +02:00
Christoph Wurst
ce259435c2
Fix DNS Pin Middleware throwing for public IPs
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-11-08 14:18:05 +01:00
Christoph Wurst
8aea25b5b9
Add remote host validation API
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-10-31 16:13:28 +01:00
Christoph Wurst
d4b9b010b0
Rename LocalAddressChecker methods to lower case
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-10-27 13:24:28 +02:00
Simon L
11108e8032 Revert "fix external storages access"
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-10-23 22:36:34 +02:00
John Molakvoæ
304c1b9b61
Merge pull request #33087 from nextcloud/fix/30282/external-storages
fix external storages access
2022-10-23 10:42:46 +02:00
Côme Chilliet
31117fa7c7
Fix tests for nested v4 in v6
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-09-20 12:46:22 +02:00
Côme Chilliet
7ac688a2e5
Use new dependency to normalize IPs
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-09-20 12:34:04 +02:00
Côme Chilliet
a907b74c2a
Add missing urldecode and idn_to_utf8 calls to local address checker
The call to idn_to_utf8 call is actually to apply normalization

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-09-20 12:20:35 +02:00
luz paz
368f83095d Fix typos in lib/private subdirectory
Found via `codespell -q 3 -S l10n -L jus ./lib/private`

Signed-off-by: luz paz <luzpaz@github.com>
2022-07-27 08:52:17 -04:00
Côme Chilliet
c5ffd7ce32
Use Symfony IpUtils to check for local IP ranges
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-07-12 12:09:05 +02:00
Côme Chilliet
707b46bb01 Check for local IPs nested in IPv6 as well
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-07-12 09:49:27 +00:00
Côme Chilliet
d0830432a7 Refactor local IP if and set strict to true for in_array
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-07-12 09:49:27 +00:00
Côme Chilliet
bd9aff47b6 Improve local IP detection
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-07-12 09:49:27 +00:00
szaimen
2ad53742f2 fix external storages access
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-07-01 22:52:10 +02:00
Côme Chilliet
d23c7d245c
Improve local domain detection
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-23 11:45:16 +02:00
Côme Chilliet
6be7aa112f
Migrate from ILogger to LoggerInterface in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +01:00
Vincent Petry
9b6a1cc8ae
Send images to imaginary docker to generate previews
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Co-Authored-by: Vincent Petry <vincent@nextcloud.com>
2022-03-17 08:24:07 +01:00
Lukas Reschke
84d9b17dc7
Check for !== false instead
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-07-12 15:06:30 +02:00
Lukas Reschke
b0cef8827d Check if dns_get_record returns non-false
`dns_get_record` can return false which results in exceptions such as
the ones shown in https://github.com/nextcloud/server/issues/27870.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-07-12 13:15:20 +02:00