summaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Http
Commit message (Collapse)AuthorAgeFilesLines
* Escape filename in Content-DispositionLukas Reschke2021-06-021-11/+25
| | | | | | We should escape all occurences of ' and \ in here. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Set frame-ancestors to none if none are filledRoeland Jago Douma2020-11-183-59/+59
| | | | | | | | frame-ancestors doesn't fall back to default-src. So when we apply a very restricted CSP we should make sure to set it to 'none' and not leave it empty. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Remove deprecated OCSResponseRoeland Jago Douma2020-11-011-64/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-051-5/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix testsJoas Schilling2020-10-021-9/+46
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke2020-08-121-1/+1
| | | | | | \PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use assertStringContainsString instead of assertContains on stringsMorris Jobke2020-07-231-2/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix IPv6 remote addresses from X_FORWARDED_FOR headers before validatingJoas Schilling2020-07-021-0/+28
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix robots "noindex, nofollow" signalsJoas Schilling2020-06-252-2/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Merge pull request #21479 from nextcloud/fix/21474/allow_specifying_cookie_typeblizzz2020-06-221-6/+13
|\ | | | | Allow to specify the cookie type for appframework responses
| * Allow to specify the cookie type for appframework responsesRoeland Jago Douma2020-06-221-6/+13
| | | | | | | | | | | | | | | | | | In general it is good to set them to Lax. But also to give devs more control over them is not a bad thing. Helps with #21474 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Fix unit test of the ResponseTestRoeland Jago Douma2020-06-211-3/+3
|/ | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #20939 from nextcloud/enh/middleware/not_modifiedRoeland Jago Douma2020-05-132-41/+1
|\ | | | | Move not modified check to the middleware
| * Move the notmodified check to middleware where it belongsRoeland Jago Douma2020-05-132-41/+1
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Fix http cache testClement Wong2020-05-121-1/+1
|/ | | | Signed-off-by: Clement Wong <git@clement.hk>
* Add visibility to all methods and position of static keywordChristoph Wurst2020-04-103-11/+11
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-1013-43/+14
| | | | | | | | | | | | | | | 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>
* Remove trailing and in between spacesChristoph Wurst2020-04-091-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-096-30/+30
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use a blank line after the opening tagChristoph Wurst2020-04-092-0/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use exactly one empty line after the namespace declarationChristoph Wurst2020-04-096-6/+0
| | | | | | For PSR2 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix (array) indent style to always use one tabChristoph Wurst2020-04-092-32/+32
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #20170 from nextcloud/techdebt/remove-unused-importsChristoph Wurst2020-03-272-2/+0
|\ | | | | Remove unused imports
| * Remove unused importsChristoph Wurst2020-03-252-2/+0
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Use the short array syntax, everywhereChristoph Wurst2020-03-268-111/+111
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-253-73/+73
|/ | | | 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-277-26/+26
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-2715-16/+16
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Some php-cs fixesRoeland Jago Douma2019-11-2215-31/+11
| | | | | | | | | | | * 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>
* Add testsRoeland Jago Douma2019-08-102-0/+266
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add feature policy headerRoeland Jago Douma2019-08-102-1/+3
| | | | | | | This adds the events and the classes to modify the feature policy. It also adds a default restricted feature policy. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update CSP test cases to handle the new form-actionRoeland Jago Douma2019-07-311-58/+58
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Set empty CSP by defaultRoeland Jago Douma2019-04-162-3/+3
| | | | | | | | | For #14179 By default responses should have the strictest (and simplest) CSP possible. Only template responses should require an actual CSP. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Set default frame-ancestors to 'self'Roeland Jago Douma2019-01-083-60/+60
| | | | | | For #13042 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* CSP: Allow fonts to be provided in dataRoeland Jago Douma2019-01-073-61/+61
| | | | 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>
* Add report-uri to CSPRoeland Jago Douma2018-10-211-0/+15
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Disallow unsafe-eval by defaultRoeland Jago Douma2018-10-143-59/+66
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Move caching logic to responseRoeland Jago Douma2018-06-041-2/+12
| | | | | | | | | | This avoids having to do it at all the places we want cached responses. We can't inject the ITimeFactor without breaking public API. However we can perfectly overwrite the service (resulting in the same testable effect). Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* 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>
* Add test for PublicTemplateResponseJulius Härtl2018-02-271-0/+84
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Fix proper typesRoeland Jago Douma2018-02-221-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix testsRoeland Jago Douma2018-02-211-12/+16
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix "Undefined method setExpectedException()"Joas Schilling2018-01-241-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Remove not needed 3rdparty app disabling during upgrade for PHP 5.xMorris Jobke2018-01-191-1/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Remove deprecated core APIJoas Schilling2018-01-151-16/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>