mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-27 08:19:22 +03:00
Support tidle in url
This commit is contained in:
parent
5326344b96
commit
09115f3228
1
integration/tests/url.exit
Normal file
1
integration/tests/url.exit
Normal file
@ -0,0 +1 @@
|
||||
0
|
6
integration/tests/url.html
Normal file
6
integration/tests/url.html
Normal 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>
|
5
integration/tests/url.hurl
Normal file
5
integration/tests/url.hurl
Normal file
@ -0,0 +1,5 @@
|
||||
GET http://localhost:8000/~user
|
||||
HTTP/1.0 200
|
||||
|
||||
GET http://localhost:8000/%7Euser
|
||||
HTTP/1.0 200
|
1
integration/tests/url.json
Normal file
1
integration/tests/url.json
Normal 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}}]}
|
6
integration/tests/user.py
Normal file
6
integration/tests/user.py
Normal file
@ -0,0 +1,6 @@
|
||||
# coding=utf-8
|
||||
from tests import app
|
||||
|
||||
@app.route("/~user")
|
||||
def url_with_tilde():
|
||||
return ''
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user