aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Http/RequestTest.php
Commit message (Collapse)AuthorAgeFilesLines
* feat(request): Allow to match the client version with the ↵Joas Schilling2023-07-111-0/+57
| | | | | | IRequest::USER_AGENT_* regex Signed-off-by: Joas Schilling <coding@schilljs.com>
* Adapt tests to config value typingCôme Chilliet2023-04-051-6/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge branch 'master' into add-scim-json-supportStanimir Bozhilov2022-12-191-2/+13
|\ | | | | Signed-off-by: Stanimir Bozhilov <stanimir.bozhilov.1998@gmail.com>
| * check if params given to API are really an arrayArtur Neumann2022-12-151-2/+13
| | | | | | | | Signed-off-by: Artur Neumann <artur@jankaritech.com>
* | Fix the JSON content type regex to match all MIME typesStanimir Bozhilov2022-09-261-0/+91
| | | | | | | | Signed-off-by: Stanimir Bozhilov <stanimir@audriga.com>
* | Add unit tests for application/scim+json content typeStanimir Bozhilov2022-09-201-0/+92
|/ | | | Signed-off-by: Stanimir Bozhilov <stanimir@audriga.com>
* Support specifying IPv6 proxies in CIDR notationSimon Leiner2022-08-021-0/+77
| | | | | | | | | | Previously, it was not possible to use CIDR notation for IPv6 proxies in the trusted_proxies parameter of config.php [1]. This patch adds support for that. [1]: https://docs.nextcloud.com/server/24/admin_manual/configuration_server/reverse_proxy_configuration.html#defining-trusted-proxies Signed-off-by: Simon Leiner <simon@leiner.me>
* Remove at matcher uses in tests/libCôme Chilliet2022-06-161-98/+79
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Adjust and add unit testsJoas Schilling2022-02-231-129/+82
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Check style updateCarl Schwan2022-01-131-8/+8
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Fix IPv6 remote addresses from X_FORWARDED_FOR headers before validatingJoas Schilling2020-07-021-0/+28
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add visibility to all methods and position of static keywordChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-3/+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-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-12/+12
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-43/+43
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-251-52/+52
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Make getServerHost more robust to faulty user inputDaniel Kesselberg2020-01-161-0/+46
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Modify regex to match some other chromium browsersDaniel Kesselberg2019-12-271-5/+26
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Mode to modern phpunitRoeland Jago Douma2019-11-271-17/+17
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-271-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Some php-cs fixesRoeland Jago Douma2019-11-221-1/+1
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Only trust the X-FORWARDED-HOST header for trusted proxiesRoeland Jago Douma2018-12-171-53/+90
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Adding handling of CIDR notation to trusted_proxies for IPv4Oliver Wegner2018-10-301-0/+115
| | | | Signed-off-by: Oliver Wegner <void1976@gmail.com>
* Remove testcaseRoeland Jago Douma2018-03-051-1/+0
| | | | | | | Since a token now always requires a string we don't need to test for null Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix proper typesRoeland Jago Douma2018-02-221-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* allow 'Nextcloud' in the user agent string of AndroidBjoern Schiessle2017-12-121-0/+14
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Use ::class in test mocksMorris Jobke2017-10-241-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Handle SameSiteCookie check for index.php in AppFramework MiddlewareRoeland Jago Douma2017-09-241-2/+12
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Don't try to parse empty body if there is no bodyRoeland Jago Douma2017-04-041-1/+4
| | | | | | | | | | | | Fixes #3890 If we do a put request without a body the current code still tries to read the body. This patch makes sure that we do not try to read the body if the content length is 0. See RFC 2616 Section 4.3 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* add test for skipping cookie checks for ocsRobin Appelman2017-03-101-0/+25
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* oc_token should be nc_tokenChristoph Wurst2017-02-021-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Harden cookies more appropriateLukas Reschke2016-11-231-0/+70
| | | | | | | | | | This adds the __Host- prefix to the same-site cookies. This is a small but yet nice security hardening. See https://googlechrome.github.io/samples/cookie-prefixes/ for the implications. Fixes https://github.com/nextcloud/server/issues/1412 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Identify Chromium as ChromeJoas Schilling2016-10-261-0/+14
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Merge pull request #797 from nextcloud/only-match-for-auth-cookieJoas Schilling2016-08-311-1/+77
|\ | | | | Match only for actual session cookie
| * Match only for actual session cookieLukas Reschke2016-08-091-1/+77
| | | | | | | | OVH has implemented load balancing in a very questionable way where the reverse proxy actually internally adds some cookies which would trigger a security exception. To work around this, this change only checks for the session cookie.
* | Remove reading PATH_INFO from server variableLukas Reschke2016-08-191-16/+0
|/ | | | | | Having two code paths for this is unreliable and can lead to bugs. Also, in some cases Apache isn't setting the PATH_INFO variable when mod_rewrite is used. Fixes https://github.com/nextcloud/server/issues/983
* [master] Port Same-Site Cookies to masterLukas Reschke2016-07-201-28/+279
| | | | Fixes https://github.com/nextcloud/server/issues/50
* Move tests/ to PSR-4 (#24731)Joas Schilling2016-05-201-0/+1453
* 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