aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Http/Client/ClientTest.php
Commit message (Collapse)AuthorAgeFilesLines
* chore: always execute parse_url in preventLocalAddressbug/noid/federated-addressbook-sync-without-localaddressallowedDaniel Kesselberg2024-10-011-1/+7
| | | | | | 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>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-3/+3
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* chore: Add SPDX headerAndy Scherzinger2024-05-131-4/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix(security): Handle idn_to_utf8 returning falseJoas Schilling2023-12-041-0/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix various deprecation warnings in tests on PHP 8.3Côme Chilliet2023-08-141-0/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* feat(HTTPClient): Provide wrapped access to Guzzle's asyncRequest()Joas Schilling2023-06-271-1/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Adapt tests to config value typingCôme Chilliet2023-04-051-72/+84
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Add remote host validation APIChristoph Wurst2022-10-311-57/+57
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Rename LocalAddressChecker methods to lower caseChristoph Wurst2022-10-271-5/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Harden tests for local IP detection in URLsCôme Chilliet2022-09-201-0/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Remove some more at matchers in tests/libCôme Chilliet2022-06-201-83/+85
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Migrate from ILogger to LoggerInterface where needed in the testsCôme Chilliet2022-03-241-8/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Improve networking checksLukas Reschke2021-04-061-40/+91
| | | | | | Whilst we currently state that SSRF is generally outside of our threat model, this is something where we should invest to improve this. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Improve CertificateManager to not be user context dependentMorris Jobke2020-11-031-3/+3
| | | | | | | | | * removes the ability for users to import their own certificates (for external storage) * reliably returns the same certificate bundles system wide (and not depending on the user context and available sessions) The user specific certificates were broken in some cases anyways, as they are only loaded if the specific user is logged in and thus causing unexpected behavior for background jobs and other non-user triggered code paths. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Do not read certificate bundle from data dir by defaultMorris Jobke2020-05-251-3/+2
| | | | | | | | | | | Before the resources/config/ca-bundle.crt was only used when the list of custom certificates was empty and the instance was not installed. But it should also be used when the list is empty and the instance is installed. This is inverting the logic to stop if the instance is not installed to use the default bundle. And it also does this when the list is empty. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Allow gzip encoded requests by defaultMorris Jobke2020-05-201-3/+7
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Check all remotes for local accessJoas Schilling2020-04-141-9/+122
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add support for GuzzleHTTP 'no' proxyMohammed Abdellatif2020-02-291-11/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The custom config allows to setup a proxy URI that is passed to GuzzleHTTP client as request options. Guzzle has the option to receive an array of proxies for each URI scheme as well as 'no' key value pair to provide a list of host names that should not be proxied to. Guzzle would automatically populate these options with HTTPS_PROXY and NO_PROXY environment variables. However, when providing a 'proxy' request option, default values will be overriden and it is required to explicitly provide the 'no' value if needed. More info: http://docs.guzzlephp.org/en/stable/request-options.html#proxy This commit will add support for a new config 'proxyexclude', which takes a list of host names to be excluded. It will also provide 'proxy' request option as an array instead of a string to Guzzle, and populate 'http' and 'https' URI schemes with proxy URI, and 'no' with 'proxyexclude' list. Also, if no 'proxy' is configured, it will leave out 'proxy' request option, so it won't override Guzzle default values. Sample config file includes a hint on how to explicitly sync 'proxyexclude' with NO_PROXY, and a note about default values. Signed-off-by: Mohammed Abdellatif <m.latief@gmail.com>
* [3rdparty] Bump guzzlehttp/guzzle from 6.3.3 to 6.5.2John Molakvoæ (skjnldsv)2020-02-111-24/+24
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Mode to modern phpunitRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add default timeout to expected request optionsDaniel Kesselberg2019-09-031-34/+19
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Correctly handle emtpy string in proxyuserpwd configScott Shambarger2019-08-111-2/+12
| | | | | | | | | | As documented, the default value for config value proxyuserpwd is ''. However, that value results in the error: "cURL error 5: Unsupported proxy syntax in '@'". This patch handles the values of '' and null (the default in the code) the same for config values proxyuserpwd and proxy. Signed-off-by: Scott Shambarger <devel@shambarger.net>
* Fix testGetProxyUriDaniel Kesselberg2019-04-161-6/+1
| | | | | | | | | | | Changed the implementation for getProxyUri with https://github.com/nextcloud/server/pull/14363/commits/fd1d85365cb1368fa70263fe3ae3b8e59ab56615 If proxy is already null then we don't ask for proxyuserpwd. Test failed because we expected getSystemValue to be called once with proxyuserpwd Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Set User-Agent as header without middlewareDaniel Kesselberg2019-04-161-35/+61
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Fix HTTP client given options being overriden by default optionsDaniel Calviño Sánchez2018-06-141-0/+127
| | | | | | | | | According to the array_merge documentation, "If the input arrays have the same string keys, then the later value for that key will overwrite the previous one." Thus, the default options must be the first parameter passed to array_merge. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* adjust httpclient to guzzle6Robin Appelman2018-02-091-31/+18
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Rebrand to "Nextcloud" and add 100% coverageLukas Reschke2017-01-021-4/+67
| | | | | | Noticed while debugging https://github.com/nextcloud/server/issues/2910 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Fix getMock Http ClientRoeland Jago Douma2016-09-071-2/+3
|
* Move tests/ to PSR-4 (#24731)Joas Schilling2016-05-201-0/+111
* Move a-b to PSR-4 * Move c-d to PSR-4 * Move e+g to PSR-4 * Move h-l to PSR-4 * Move m-r to PSR-4 * Move s-u to PSR-4 * Move files/ to PSR-4 * Move remaining tests to PSR-4 * Remove Test\ from old autoloader