summaryrefslogtreecommitdiffstats
path: root/lib/private/Http
Commit message (Collapse)AuthorAgeFilesLines
* Format control structures, classes, methods and functionChristoph Wurst2020-04-102-2/+1
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add support for GuzzleHTTP 'no' proxyMohammed Abdellatif2020-02-291-7/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Update license headersChristoph Wurst2019-12-054-4/+18
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Set a default request timeoutRoeland Jago Douma2019-09-021-0/+1
| | | | | | | | This to avoid endless running processes. A default timeout of 30 seconds should cover the 99% case. If a job need specific longer time it should set that. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Correctly handle emtpy string in proxyuserpwd configScott Shambarger2019-08-111-4/+4
| | | | | | | | | | 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>
* Refactor getProxyUriDaniel Kesselberg2019-04-161-9/+6
| | | | | | Get proxyuserpwd only if proxy not empty. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Set User-Agent as header without middlewareDaniel Kesselberg2019-04-162-57/+35
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* HttpClient getHeader can return empty stringRoeland Jago Douma2019-01-081-1/+7
| | | | | | Fixes #11999 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make authenticated cookies laxRoeland Jago Douma2018-09-281-0/+75
| | | | | | | | | | | | | | This protects our cookies a bit more. It makes sure that when a 3rdparty websites embededs a public alendar for example. That all the users see this in anonymous mode there. It adds a small helper function. In the future we can think about protecting other cookies like this as well. But for now this is sufficient to not have the user logged in at all when doing 3rdparty requests. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix HTTP client given options being overriden by default optionsDaniel Calviño Sánchez2018-06-141-6/+6
| | | | | | | | | 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 post body for new guzzleRobin Appelman2018-02-091-0/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* adjust httpclient to guzzle6Robin Appelman2018-02-093-25/+47
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Make OCP\Http strictRoeland Jago Douma2018-01-163-19/+24
| | | | | | | | | | * Handle private files * Add return types * Add scalar typehints * Made strict * Fixed requiring proper guzzle message interface that is passed around Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Rebrand to "Nextcloud" and add 100% coverageLukas Reschke2017-01-021-5/+6
| | | | | | Noticed while debugging https://github.com/nextcloud/server/issues/2910 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Update with robinJoas Schilling2016-07-212-2/+2
|
* Fix othersJoas Schilling2016-07-213-3/+6
|
* Update license headersLukas Reschke2016-05-263-3/+3
|
* only configure the http client once we start using itRobin Appelman2016-05-121-6/+23
|
* Move \OC\Http to PSR-4Roeland Jago Douma2016-04-283-0/+431