]> source.dussan.org Git - nextcloud-server.git/commit
Respect `mod_unique_id` and refactor `OC_Request::getRequestId`
authorLukas Reschke <lukas@owncloud.com>
Mon, 9 Feb 2015 10:41:48 +0000 (11:41 +0100)
committerLukas Reschke <lukas@owncloud.com>
Mon, 9 Feb 2015 10:53:11 +0000 (11:53 +0100)
commit770fa761b8bf8452ff17a2036ca8413e74935a3d
treeecce3b7443278b0ebdac588ba40840190a3aadcd
parent0e604aa875a677f76b2bf326631646ac31fbadbd
Respect `mod_unique_id` and refactor `OC_Request::getRequestId`

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
16 files changed:
lib/private/appframework/http/request.php
lib/private/log/owncloud.php
lib/private/request.php
lib/private/server.php
lib/private/template.php
lib/public/irequest.php
tests/lib/appframework/controller/ApiControllerTest.php
tests/lib/appframework/controller/ControllerTest.php
tests/lib/appframework/dependencyinjection/DIContainerTest.php
tests/lib/appframework/http/DispatcherTest.php
tests/lib/appframework/http/RequestTest.php
tests/lib/appframework/middleware/MiddlewareDispatcherTest.php
tests/lib/appframework/middleware/MiddlewareTest.php
tests/lib/appframework/middleware/security/CORSMiddlewareTest.php
tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php
tests/lib/appframework/middleware/sessionmiddlewaretest.php