Commit graph

12 commits

Author SHA1 Message Date
Reedy
85396a9c99 tests: Fix @covers and @coversDefaultClass to have leading \
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
2024-02-16 22:43:56 +00:00
Matěj Suchánek
45390a52eb Clean up tests
Replace strpos with str_contains, str_starts_with, etc.
Fix spelling of "cannot" and other typos.

Change-Id: Ie52900b323f46d1978a9dd9ea3b17619b8942160
2024-02-12 09:25:25 +01:00
Piotr Miazga
8009e9d027 http: MultiHttpClient supports TelemetryHeadersInterface
Introduce a new interface Wikimedia/Http/TelemetryHeadersInterface
that provides telemetry information that could be attached to
HTTP Requests. MultiHttpClient is expecting `telemetry` option
of TelemetryHeadersInterface type.

The MediaWiki/Http/Telemetry implements the interface, therefore
ObjectCache can inject it to RESTBagOStuff, that further injects
it to MultiHttpClient.

Bug: T344926
Change-Id: I59a3f1048c403fe2e4ef0c74353dfe74ff9ca893
2023-09-12 18:05:17 +02:00
Piotr Miazga
67c1e15469 http: Propagate tracestate and traceparent headers
Introduce a Telemetry singleton for propagating `tracestate` and
`traceheaders` during a MW web request. This class allows for easier
testing and mocking.

In the future we might use this as a wrapper for OpenTelemetry.

Bug: T320559
Change-Id: I3e5e54afa21f8c099877b3765c769f2d2f8f5d61
2023-08-07 21:04:19 +00:00
Umherirrender
8315e91863 Remove deprecated MWHttpRequest::factory
Bug: T324918
Change-Id: Ie03d4b25eb239bbbbc2346821a86f09c29e03524
2023-04-26 22:23:06 +02:00
Umherirrender
a486e302ac Hard-deprecate MWHttpRequest::factory
Bug: T324918
Change-Id: I360d57b5aa9e2e8cbfc8b5c5654ab1aaf1d944b3
2023-02-13 23:22:11 +01:00
Umherirrender
4cc5ee4772 Replace comment about deprecated Http::request
Bug: T305813
Change-Id: I76ea5e98b133ab07d2ef71bbcebd0646b6f2f5ad
2022-12-11 15:20:06 +01:00
Umherirrender
d6c5203653 tests: Use ::class in assertInstanceOf function
Change-Id: I1b498c88c702c131553c8948bcec5730ec0dcb35
2022-01-16 21:17:09 +01:00
Kunal Mehta
bfad87aae8 http: Don't set X-Forwarded-Proto when using a reverse proxy
Discussion on Ia16d8f86b1cb20 indicates that we want to go in the other
direction - MediaWiki shouldn't set X-Forwarded-Proto, rather the
reverse proxy (envoy in Wikimedia's case) should set it.

This follows-up cc241c2add.

Bug: T288848
Change-Id: Ifc5e9da9a02b45d9d1ad51c3e1389f9ac7325c86
2021-11-17 23:09:24 +00:00
Alexander Vorwerk
bd13a42535 build: Update mediawiki-codesniffer from v37.0.0 to v38.0.0
Change-Id: Iff096d3789b8c261aa47fb41d6f450a3bda7ce6a
2021-10-22 22:43:16 +02:00
Kunal Mehta
cc241c2add Allow using a reverse proxy for local HTTP requests
$wgLocalHTTPProxy can be used to configure a reverse proxy
for requests to domains in $wgLocalVirtualHosts. The previous
implementation of using it as a proper HTTP proxy is no longer
supported and has been reverted out of REL1_37 (856da72363d1ba8bf).

It sets the hostname of the request as a "Host" header, scheme as
"X-Forwarded-Proto" and then sets the proxy's scheme, host and port as
those of the request.

Bug: T288848
Change-Id: Ibc3616f5ad925d464d937ab15461a88619c8b7a7
2021-10-15 10:56:46 -07:00
Kunal Mehta
e7a4225596 tests: MWHttpRequestTest is a unit test, not an integration test
Change-Id: Iea8aff749c4e7da3fbfb0f6c3fbefd450d9a3b6a
2021-10-08 12:24:34 -07:00
Renamed from tests/integration/includes/http/MWHttpRequestTest.php (Browse further)