fiwswe
6c16a3a9aa
Use str_starts_with/str_ends_with
2023-09-14 23:06:43 +02:00
Andreas Gohr
d4f83172d9
code style: line breaks
2023-08-31 22:44:40 +02:00
Andreas Gohr
fe15e2c063
code style: static visibility
2023-08-31 22:42:02 +02:00
Andreas Gohr
26dfc2323f
Rector to rename print to echo calls
2023-08-31 22:00:27 +02:00
Andreas Gohr
7d34963b3e
coding style: control flow line breaks
2023-08-31 15:04:10 +02:00
Andreas Gohr
177d6836e2
coding style: control flow whitespaces
2023-08-31 14:22:35 +02:00
Andreas Gohr
dccd6b2bba
coding style: function call spacing
2023-08-30 18:41:45 +02:00
Andreas Gohr
8c7c53b032
codestyle adjustments: class declaration braces
2023-08-30 17:05:28 +02:00
Andreas Gohr
8553d24d33
Apply rector renames
2023-08-30 15:44:19 +02:00
Andreas Gohr
51bc25345d
fix codesniffer violations
2023-08-29 19:51:36 +02:00
Andreas Gohr
a3b08db51d
Apply rector fixes to inc/HTTP
2023-08-29 17:32:36 +02:00
Andreas Gohr
605810ee2f
use local squid docker instance for proxy testing
2023-04-26 20:23:44 +02:00
Andreas Gohr
753d9add8c
Merge pull request #3941 from glensc/microtime
...
HttpClient::time(): use microtime(true) directly
2023-04-06 08:51:25 +02:00
Elan Ruusamäe
e8b8bf8cec
HTTPClient: Replace time() method with direct microtime(true) call
2023-04-05 20:37:07 +03:00
Elan Ruusamäe
8a10b6f0b9
Minor fixes in comments
2023-04-05 15:50:47 +03:00
Elan Ruusamäe
88743d14b0
HttpClient::time use microtime(true) directly
2023-04-05 15:26:33 +03:00
Andreas Gohr
d9a7912a64
use httpbingo for HTPP tests
...
This service is based on httpbin-go which seems to be better maintained
and should be easy to set up for ourselves if needed.
This also fixes a warning when the client is reused with the
max_bodysize mechanism
2023-01-31 12:11:59 +01:00
Andreas Gohr
ec34bb300b
Update core code to make use of sexplode()
...
This makes use of our own explode mechanism everywhere were we expect a
fixed number of results.
2022-10-19 15:29:26 +02:00
Andreas Gohr
bf8f8509c5
guard against unset parameters
...
Many string function will throw a deprecation warning in PHP 8.1 when
null is passed. This adds a few guards in some of our methods (not all,
yet)
2022-01-01 13:24:13 +01:00
Tom Kunze
67600f75ff
HTTPClient: Fix missing processing of redirections with status code 303, 307, 308.
...
HTTP/1.1 (RFC 7231) and RFC 7538 also define the redirection status codes 303,
307 and 308. These should be also supported as they are used more widely
nowadays (e.g. Google Docs).
2021-08-01 23:12:36 +02:00
Damien Regad
66b64c2aa3
Address Scrutinizer inspection failure
...
The variable ``$port`` seems only to be defined at a later point.
As such the call to ``isset()`` seems to always evaluate to ``false``.
2021-02-07 00:23:03 +01:00
Damien Regad
056bf31f71
Fix various errors in PHPUnit tests on PHP 8
2021-02-06 01:19:58 +01:00
Andreas Gohr
6cda96e3cf
Restrictive Content-Security-Policy for media #1045
...
This adds a CSP header for all media delivered through our fetch.php
dispatcher. This should revent any scripts etc. to be executed when
scriptable media, like SVG is used.
Suggestions on finetuning the policy are welcome.
The policy is added to the MEDIA_SENDFILE event, so plugins can easily
influence it. The way it is passed as an array should make it easier to
modify from plugins as well.
I put the mechanism to send the header into it's own class in the HTTP
namespace. Additional methods from inc/httputils could be moved here
later. The method might also be interesting for #2198 and #1676 .
2020-10-14 15:10:47 +02:00
fiwswe
03c2c42877
Update HTTPClient.php
...
Fix the problem on OpenBSD 6.7, PHP 7.4.5-7.4.6 that prevents the extension repository to be pinged. See #3148 .
2020-06-14 02:33:52 +02:00
Andreas Gohr
980f9f38c2
check exceptions before proxy use #3055
...
There are several places in the HTTPClient where we check if a proxy is
set. But not all of them were checking the exceptions.
2020-04-29 21:16:42 +02:00
Andreas Gohr
e1d9dcc8b4
First go at moving the plugin classes into their own namespace
2019-04-20 21:33:23 +02:00
Michael Große
5a8d6e48ea
Rename HTTPClient namespace to HTTP
...
This should make namespace a bit more flexible in scope and allow us to
move more functionality there later.
2019-03-26 22:05:09 +01:00