aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/appframework/http/RequestTest.php
Commit message (Collapse)AuthorAgeFilesLines
* Move tests/ to PSR-4 (#24731)Joas Schilling2016-05-201-1454/+0
| | | | | | | | | | | | | | | | | | | | * 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
* Fix namespaces in AppFramework testsJoas Schilling2016-05-181-1/+2
|
* Add new CSRF manager for unit testing purposesLukas Reschke2016-01-251-4/+86
| | | | This adds a new CSRF manager for unit testing purposes, it's interface is based upon https://github.com/symfony/security-csrf. Due to some of our required custom changes it is however not possible to use the Symfony component directly.
* Fix unit testsRoeland Jago Douma2016-01-111-8/+1
|
* Scrutinizer Auto-FixesScrutinizer Auto-Fixer2015-12-071-1/+0
| | | | This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
* Added tests.Mitar2015-11-271-0/+20
|
* Fix undefined HTTP_USER_AGENTThomas Müller2015-11-221-8/+25
|
* Remove dependency on ICrypto + use XORLukas Reschke2015-10-211-78/+6
|
* Merge pull request #19034 from owncloud/http-request-warningThomas Müller2015-10-081-0/+21
|\ | | | | Prevent warning decoding content
| * Unit test for preventing warning decoding contentRobin McCorkell2015-09-231-0/+21
| |
* | Add \OCP\IRequest::getHttpProtocolLukas Reschke2015-10-061-0/+51
| | | | | | | | | | | | Only allow valid HTTP protocols. Ref https://github.com/owncloud/core/pull/19537#discussion_r41252333 + https://github.com/owncloud/security-tracker/issues/119
* | use assertSame, add failing caseJörn Friedrich Dreyer2015-09-231-43/+44
|/
* Add mitigation against BREACHLukas Reschke2015-08-141-15/+102
| | | | | | | | | | | | While BREACH requires the following three factors to be effectively exploitable we should add another mitigation: 1. Application must support HTTP compression 2. Response most reflect user-controlled input 3. Response should contain sensitive data Especially part 2 is with ownCloud not really given since user-input is usually only echoed if a CSRF token has been passed. To reduce the risk even further it is however sensible to encrypt the CSRF token with a shared secret. Since this will change on every request an attack such as BREACH is not feasible anymore against the CSRF token at least.
* Use StringUtils::equals on CSRF token and add unit testsLukas Reschke2015-08-041-0/+95
|
* Fixing 'Undefined index: REMOTE_ADDR' - fixes #17460Thomas Müller2015-07-161-4/+15
|
* Fix undefined offsetLukas Reschke2015-06-221-2/+91
| | | | There are cases where no trusted host is specified such as when installing the instance, this lead to an undefined offset warning in the log right after installing. (when another domain than localhost or 127.0.0.1 was used)
* Move the helpful method to the TestCase classJoas Schilling2015-06-031-2/+2
|
* Get the real protocol behind several proxiesLukas Reschke2015-02-241-0/+21
| | | | | | X-Forwarded-Proto contains a list of protocols if ownCloud is behind multiple reverse proxies. This is a revival of https://github.com/owncloud/core/pull/11157 using the new IRequest public API.
* Refactor OC_Request into TrustedDomainHelper and IRequestLukas Reschke2015-02-161-20/+784
| | | | | | | | | | This changeset removes the static class `OC_Request` and moves the functions either into `IRequest` which is accessible via `\OC::$server::->getRequest()` or into a separated `TrustedDomainHelper` class for some helper methods which should not be publicly exposed. This changes only internal methods and nothing on the public API. Some public functions in `util.php` have been deprecated though in favour of the new non-static functions. Unfortunately some part of this code uses things like `__DIR__` and thus is not completely unit-testable. Where tests where possible they ahve been added though. Fixes https://github.com/owncloud/core/issues/13976 which was requested in https://github.com/owncloud/core/pull/13973#issuecomment-73492969
* Respect `mod_unique_id` and refactor `OC_Request::getRequestId`Lukas Reschke2015-02-091-14/+54
| | | | | | | | | | | | | | When `mod_unique_id` is enabled the ID generated by it will be used for logging. This allows for correlation of the Apache logs and the ownCloud logs. Testplan: - [ ] When `mod_unique_id` is enabled the request ID equals the one generated by `mod_unique_id`. - [ ] When `mod_unique_id` is not available the request ID is a 20 character long random string - [ ] The generated Id is stable over the lifespan of one request Changeset looks a little bit larger since I had to adjust every unit test using the HTTP\Request class for proper DI. Fixes https://github.com/owncloud/core/issues/13366
* always set url parameters when they are available in the app dispatchBernhard Posselt2015-01-151-0/+17
| | | | | | prefer url parameters passed into the main method. If they are not present, use the containers urlParameters add space
* Make remaining files extend the test baseJoas Schilling2014-11-191-3/+6
|
* default to GET request when no method is set to fix unittests, also set ↵Bernhard Posselt2014-04-121-12/+16
| | | | parsed json parameters on the post attribute
* Fix fix of POST :PThomas Tanghus2013-10-031-2/+2
|
* Modified PUT behaviourThomas Tanghus2013-10-021-24/+30
| | | | Now only non-parable PUT requests return a stream resource.
* Add assertions for ->params and array access with jsonThomas Tanghus2013-10-011-0/+2
|
* Implement PUT an PATCH supportThomas Tanghus2013-10-011-1/+100
|
* Check if accessor matched request method.Thomas Tanghus2013-10-011-0/+27
| | | | It's easier to find errors in the code if an exception is thrown.
* kill superfluent classloader from tests - this approach might be of interest ↵Thomas Müller2013-08-211-2/+0
| | | | within the apps
* initial import of appframeworkThomas Müller2013-08-171-0/+78