commit - ee0861c8f3edaf7e361fe2c90a2341dd89a1d984
commit + e3d510f54dd27b2a9674e8fbe051d69969d48a90
blob - 8b266eeb9ade6abe27c9aba7f8dd16369f028e4f
blob + 13d42a89a2991acc499aef91057a92efaf9044db
--- tests/test_request.cc
+++ tests/test_request.cc
IS_TRUE(path == path_literal)
CASE_OK("gemini://host", "");
- CASE_OK("gemini://host/", "");
+ CASE_OK("gemini://host/", "/");
CASE_OK("gemini://host/a", "a");
- CASE_OK("gemini://host/a/", "a");
+ CASE_OK("gemini://host/a/", "a/");
CASE_OK("gemini://host/a/b", "a/b");
- CASE_OK("gemini://host/a/b/", "a/b");
+ CASE_OK("gemini://host/a/b/", "a/b/");
CASE_OK("gemini://host:1965", "");
- CASE_OK("gemini://host:1965/", "");
+ CASE_OK("gemini://host:1965/", "/");
CASE_OK("gemini://host:1965/a", "a");
- CASE_OK("gemini://host:1965/a/", "a");
+ CASE_OK("gemini://host:1965/a/", "a/");
CASE_OK("gemini://host:1965/a/b", "a/b");
- CASE_OK("gemini://host:1965/a/b/", "a/b");
+ CASE_OK("gemini://host:1965/a/b/", "a/b/");
CASE_OK("gemini://host/a/b/../c/./d", "a/c/d");
blob - e0d4eb17cf214b9012e7bfc4b6191d91444626cd
blob + 12ac2a5cf55579b9ed761481c1a951dc0560f983
--- vostok/request.cc
+++ vostok/request.cc
}
}
+ const bool is_slash_on_end = (*m_buffer.crbegin() == '/');
+
// normalize '.' and '..'
const auto ret = PathNormalization{}(current, m_buffer);
if (ret == URL_OK)
+ {
m_buffer.swap(path);
+ if (is_slash_on_end)
+ path.push_back('/');
+ }
return ret;
}