summaryrefslogtreecommitdiff
path: root/src/site.cc
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2021-11-18 00:20:23 +0100
committerJoel Klinghed <the_jk@spawned.biz>2021-11-18 00:24:41 +0100
commit8b04f96297f678b22d5c4374456dba6f79827257 (patch)
tree973c2ac7de94186d7379551559c9b401514c251b /src/site.cc
parent33405111d53ac0288adbd2881f3e5a7c1cacc999 (diff)
site & transport: Make sure to url escape Location header
Diffstat (limited to 'src/site.cc')
-rw-r--r--src/site.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/site.cc b/src/site.cc
index f8d8116..ebc12a7 100644
--- a/src/site.cc
+++ b/src/site.cc
@@ -91,8 +91,9 @@ public:
if (slash == std::string::npos) {
auto trip_id = request->path().substr(1);
if (trip_.count(std::string(trip_id)))
- return transport->create_redirect(std::string(request->path()) + "/",
- false);
+ return transport->create_redirect(
+ url::escape(request->path(), url::EscapeFlags::KEEP_SLASH) + "/",
+ false);
} else {
auto trip_id = std::string(request->path().substr(1, slash - 1));
auto trip_it = trip_.find(trip_id);