mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
Fix subdirectory deployments in a generic manner (#802)
* Fix subdirectory deployments in a generic manner by modifying`request.path` to combine both `request.script_root` and `request.path` and also creating a request preprocessor to redirect users into the true CTFd app. Without this sessions will be invalid because sessions will be set to a subdirectory. * Add a test for testing subdirectory deployments and the customized CTFdRequest object. * Fix `TestingConfig.SAFE_MODE` getting stuck in between tests. * Order AWS keys properly in travis.yml * Redirect to `request.full_path` instead of just `request.path`
This commit is contained in:
@@ -116,7 +116,7 @@ def test_user_get_logout():
|
||||
client = login_as_user(app)
|
||||
client.get('/logout', follow_redirects=True)
|
||||
r = client.get('/challenges')
|
||||
assert r.location == "http://localhost/login?next=%2Fchallenges"
|
||||
assert r.location == "http://localhost/login?next=%2Fchallenges%3F"
|
||||
assert r.status_code == 302
|
||||
destroy_ctfd(app)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user