Support tidle in url

This commit is contained in:
Fabrice Reix 2021-10-14 09:05:03 +02:00 committed by Fabrice Reix
parent 5326344b96
commit 09115f3228
6 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1,6 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/~user</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="number">200</span></span>
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
<span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/%7Euser</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="number">200</span></span>
</span></span></code></pre>

View File

@ -0,0 +1,5 @@
GET http://localhost:8000/~user
HTTP/1.0 200
GET http://localhost:8000/%7Euser
HTTP/1.0 200

View File

@ -0,0 +1 @@
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/~user"},"response":{"version":"HTTP/1.0","status":200}},{"request":{"method":"GET","url":"http://localhost:8000/%7Euser"},"response":{"version":"HTTP/1.0","status":200}}]}

View File

@ -0,0 +1,6 @@
# coding=utf-8
from tests import app
@app.route("/~user")
def url_with_tilde():
return ''

View File

@ -206,8 +206,10 @@ fn url(reader: &mut Reader) -> ParseResult<'static, Template> {
None => break,
Some(c) => {
if c.is_alphanumeric()
|| vec![':', '/', '.', '-', '?', '=', '&', '_', '%', '*', ',', '@']
.contains(&c)
|| vec![
':', '/', '.', '-', '?', '=', '&', '_', '%', '*', ',', '@', '~',
]
.contains(&c)
{
buffer.push(c);
} else {