diff --git a/integration/tests/url.exit b/integration/tests/url.exit new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/integration/tests/url.exit @@ -0,0 +1 @@ +0 diff --git a/integration/tests/url.html b/integration/tests/url.html new file mode 100644 index 000000000..fb3cc11e6 --- /dev/null +++ b/integration/tests/url.html @@ -0,0 +1,6 @@ +
GET http://localhost:8000/~user
+HTTP/1.0 200
+
+GET http://localhost:8000/%7Euser
+HTTP/1.0 200
+
\ No newline at end of file
diff --git a/integration/tests/url.hurl b/integration/tests/url.hurl
new file mode 100644
index 000000000..5b6918b79
--- /dev/null
+++ b/integration/tests/url.hurl
@@ -0,0 +1,5 @@
+GET http://localhost:8000/~user
+HTTP/1.0 200
+
+GET http://localhost:8000/%7Euser
+HTTP/1.0 200
diff --git a/integration/tests/url.json b/integration/tests/url.json
new file mode 100644
index 000000000..47241e1d9
--- /dev/null
+++ b/integration/tests/url.json
@@ -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}}]}
\ No newline at end of file
diff --git a/integration/tests/user.py b/integration/tests/user.py
new file mode 100644
index 000000000..132d6c918
--- /dev/null
+++ b/integration/tests/user.py
@@ -0,0 +1,6 @@
+# coding=utf-8
+from tests import app
+
+@app.route("/~user")
+def url_with_tilde():
+ return ''
\ No newline at end of file
diff --git a/packages/hurl_core/src/parser/parsers.rs b/packages/hurl_core/src/parser/parsers.rs
index b35c0f5b0..a25e8568d 100644
--- a/packages/hurl_core/src/parser/parsers.rs
+++ b/packages/hurl_core/src/parser/parsers.rs
@@ -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 {