diff --git a/integration/hurl/tests_error_parser/invalid_url.err b/integration/hurl/tests_error_parser/invalid_url.err deleted file mode 100644 index 94699e96b98..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url.err +++ /dev/null @@ -1,7 +0,0 @@ -error: Parsing URL - --> tests_error_parser/invalid_url.hurl:1:26 - | - 1 | GET http://localhost:8000> # - | ^ illegal character <>> - | - diff --git a/integration/hurl/tests_error_parser/invalid_url.exit b/integration/hurl/tests_error_parser/invalid_url.exit deleted file mode 100644 index d8263ee9860..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url.exit +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/integration/hurl/tests_error_parser/invalid_url.hurl b/integration/hurl/tests_error_parser/invalid_url.hurl deleted file mode 100644 index 41872ef4490..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url.hurl +++ /dev/null @@ -1 +0,0 @@ -GET http://localhost:8000> # \ No newline at end of file diff --git a/integration/hurl/tests_error_parser/invalid_url.ps1 b/integration/hurl/tests_error_parser/invalid_url.ps1 deleted file mode 100644 index 4c3f7575f9f..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Set-StrictMode -Version latest -$ErrorActionPreference = 'Stop' -hurl tests_error_parser/invalid_url.hurl diff --git a/integration/hurl/tests_error_parser/invalid_url.sh b/integration/hurl/tests_error_parser/invalid_url.sh deleted file mode 100755 index 72c6f28c084..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -set -Eeuo pipefail -hurl tests_error_parser/invalid_url.hurl diff --git a/integration/hurl/tests_error_parser/invalid_url_1.err b/integration/hurl/tests_error_parser/invalid_url_1.err deleted file mode 100644 index 99d6fdf35af..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url_1.err +++ /dev/null @@ -1,7 +0,0 @@ -error: Parsing URL - --> tests_error_parser/invalid_url_1.hurl:1:5 - | - 1 | GET localhost:8000 - | ^ expecting http://, https:// or {{ - | - diff --git a/integration/hurl/tests_error_parser/invalid_url_1.exit b/integration/hurl/tests_error_parser/invalid_url_1.exit deleted file mode 100644 index d8263ee9860..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url_1.exit +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/integration/hurl/tests_error_parser/invalid_url_1.hurl b/integration/hurl/tests_error_parser/invalid_url_1.hurl deleted file mode 100644 index 2626e08ee94..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url_1.hurl +++ /dev/null @@ -1 +0,0 @@ -GET localhost:8000 diff --git a/integration/hurl/tests_error_parser/invalid_url_1.ps1 b/integration/hurl/tests_error_parser/invalid_url_1.ps1 deleted file mode 100644 index 68c73ccbe77..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url_1.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Set-StrictMode -Version latest -$ErrorActionPreference = 'Stop' -hurl tests_error_parser/invalid_url_1.hurl diff --git a/integration/hurl/tests_error_parser/invalid_url_1.sh b/integration/hurl/tests_error_parser/invalid_url_1.sh deleted file mode 100755 index 9165bf4ac0d..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url_1.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -set -Eeuo pipefail -hurl tests_error_parser/invalid_url_1.hurl diff --git a/integration/hurl/tests_error_parser/invalid_url_2.err b/integration/hurl/tests_error_parser/invalid_url_2.err deleted file mode 100644 index bfae406bd10..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url_2.err +++ /dev/null @@ -1,7 +0,0 @@ -error: Parsing URL - --> tests_error_parser/invalid_url_2.hurl:1:5 - | - 1 | GET http:localhost:8000 - | ^ expecting http://, https:// or {{ - | - diff --git a/integration/hurl/tests_error_parser/invalid_url_2.exit b/integration/hurl/tests_error_parser/invalid_url_2.exit deleted file mode 100644 index d8263ee9860..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url_2.exit +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/integration/hurl/tests_error_parser/invalid_url_2.hurl b/integration/hurl/tests_error_parser/invalid_url_2.hurl deleted file mode 100644 index 0fa8679f2b4..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url_2.hurl +++ /dev/null @@ -1 +0,0 @@ -GET http:localhost:8000 diff --git a/integration/hurl/tests_error_parser/invalid_url_2.ps1 b/integration/hurl/tests_error_parser/invalid_url_2.ps1 deleted file mode 100644 index c0a0f25ca27..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url_2.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Set-StrictMode -Version latest -$ErrorActionPreference = 'Stop' -hurl tests_error_parser/invalid_url_2.hurl diff --git a/integration/hurl/tests_error_parser/invalid_url_2.sh b/integration/hurl/tests_error_parser/invalid_url_2.sh deleted file mode 100755 index 957c302a712..00000000000 --- a/integration/hurl/tests_error_parser/invalid_url_2.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -set -Eeuo pipefail -hurl tests_error_parser/invalid_url_2.hurl diff --git a/integration/hurl/tests_error_parser/parallel_parsing_error.err b/integration/hurl/tests_error_parser/parallel_parsing_error.err index 3392439212e..5a67a13bb31 100644 --- a/integration/hurl/tests_error_parser/parallel_parsing_error.err +++ b/integration/hurl/tests_error_parser/parallel_parsing_error.err @@ -1,7 +1,7 @@ -[1;31merror[0m: [1mParsing URL[0m - [1;34m-->[0m tests_error_parser/parallel_parsing_error_c.hurl:4:5 +[1;31merror[0m: [1mParsing space[0m + [1;34m-->[0m tests_error_parser/parallel_parsing_error_c.hurl:4:4 [1;34m |[0m -[1;34m 4 |[0m GET //localhost:8000/hello -[1;34m |[0m[1;31m ^ expecting http://, https:// or {{[0m +[1;34m 4 |[0m GET//localhost:8000/hello +[1;34m |[0m[1;31m ^ expecting a space[0m [1;34m |[0m diff --git a/integration/hurl/tests_error_parser/parallel_parsing_error_c.hurl b/integration/hurl/tests_error_parser/parallel_parsing_error_c.hurl index 619b1aec6fc..523d98156ad 100644 --- a/integration/hurl/tests_error_parser/parallel_parsing_error_c.hurl +++ b/integration/hurl/tests_error_parser/parallel_parsing_error_c.hurl @@ -1,7 +1,7 @@ GET http://localhost:8000/hello HTTP 200 -GET //localhost:8000/hello +GET//localhost:8000/hello HTTP 200 GET http://localhost:8000/hello diff --git a/integration/hurl/tests_error_parser/url_bad_prefix.err b/integration/hurl/tests_error_parser/url_bad_prefix.err deleted file mode 100644 index a05d3ccad5c..00000000000 --- a/integration/hurl/tests_error_parser/url_bad_prefix.err +++ /dev/null @@ -1,7 +0,0 @@ -error: Parsing URL - --> tests_error_parser/url_bad_prefix.hurl:4:5 - | - 4 | GET "http://localhost:8000" - | ^ expecting http://, https:// or {{ - | - diff --git a/integration/hurl/tests_error_parser/url_bad_prefix.exit b/integration/hurl/tests_error_parser/url_bad_prefix.exit deleted file mode 100644 index d8263ee9860..00000000000 --- a/integration/hurl/tests_error_parser/url_bad_prefix.exit +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/integration/hurl/tests_error_parser/url_bad_prefix.hurl b/integration/hurl/tests_error_parser/url_bad_prefix.hurl deleted file mode 100644 index fd27717fe5a..00000000000 --- a/integration/hurl/tests_error_parser/url_bad_prefix.hurl +++ /dev/null @@ -1,4 +0,0 @@ -# URL in Hurl are not quoted strings: -# it's should be: -# GET http://localhost:8000 -GET "http://localhost:8000" \ No newline at end of file diff --git a/integration/hurl/tests_error_parser/url_bad_prefix.ps1 b/integration/hurl/tests_error_parser/url_bad_prefix.ps1 deleted file mode 100644 index f45351ae997..00000000000 --- a/integration/hurl/tests_error_parser/url_bad_prefix.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Set-StrictMode -Version latest -$ErrorActionPreference = 'Stop' -hurl tests_error_parser/url_bad_prefix.hurl diff --git a/integration/hurl/tests_error_parser/url_bad_prefix.sh b/integration/hurl/tests_error_parser/url_bad_prefix.sh deleted file mode 100755 index 2b3dc0672c3..00000000000 --- a/integration/hurl/tests_error_parser/url_bad_prefix.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -set -Eeuo pipefail -hurl tests_error_parser/url_bad_prefix.hurl diff --git a/integration/hurl/tests_ok/querystring_params.curl b/integration/hurl/tests_ok/querystring_params.curl index 159caf197a8..1b1e05be059 100644 --- a/integration/hurl/tests_ok/querystring_params.curl +++ b/integration/hurl/tests_ok/querystring_params.curl @@ -1,7 +1,7 @@ -curl 'http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3Db¶m4=1%2C2%2C3&$top=5' -curl 'http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3Db¶m4=1%2C2%2C3&$top=5' -curl 'http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3db¶m4=1,2,3&$top=5' -curl 'http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3Db¶m4=1%2C2%2C3&$top=5' -curl 'http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3Db¶m4=1%2C2%2C3&$top=5' +curl 'http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3Db¶m4=1%2C2%2C3¶m5=\{bar\}&$top=5' +curl 'http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3Db¶m4=1%2C2%2C3¶m5=\{bar\}&$top=5' +curl 'http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3db¶m4=1,2,3¶m5=\{bar\}&$top=5' +curl 'http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3Db¶m4=1%2C2%2C3¶m5=\{bar\}&$top=5' +curl 'http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3Db¶m4=1%2C2%2C3¶m5=\{bar\}&$top=5' curl 'http://localhost:8000/querystring-params-encoded?value1=/&value2=%2F&value3=%2F' curl 'http://localhost:8000/querystring-params-encoded?value1=/&value2=%2F&value3=%2F' diff --git a/integration/hurl/tests_ok/querystring_params.hurl b/integration/hurl/tests_ok/querystring_params.hurl index 1f205471de7..991c69e7cd9 100644 --- a/integration/hurl/tests_ok/querystring_params.hurl +++ b/integration/hurl/tests_ok/querystring_params.hurl @@ -4,6 +4,7 @@ param1: value1 param2: param3: a=b param4: 1,2,3 +param5: {bar} $top: 5 HTTP 200 @@ -14,12 +15,13 @@ param1: value1 param2: param3: a=b param4: 1,2,3 +param5: {bar} $top: 5 HTTP 200 # Same version as raw -GET http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3db¶m4=1,2,3&$top=5 +GET http://localhost:8000/querystring-params?param1=value1¶m2=¶m3=a%3db¶m4=1,2,3¶m5={bar}&$top=5 HTTP 200 @@ -29,11 +31,12 @@ GET http://localhost:8000/querystring-params?param1=value1 param2: param3: a=b param4: 1,2,3 +param5: {bar} $top: 5 HTTP 200 -GET http://localhost:8000/querystring-params?param1=value1 +GET http://localhost:8000/querystring-params?param1=value1¶m5={bar} [Query] param2: param3: a=b diff --git a/integration/hurl/tests_ok/querystring_params.py b/integration/hurl/tests_ok/querystring_params.py index 9ad1f3b71c4..90cbac8cffd 100644 --- a/integration/hurl/tests_ok/querystring_params.py +++ b/integration/hurl/tests_ok/querystring_params.py @@ -8,6 +8,7 @@ def querystring_params(): assert request.args.get("param2") == "" assert request.args.get("param3") == "a=b" assert request.args.get("param4") == "1,2,3" + assert request.args.get("param5") == "{bar}" assert request.args.get("$top") == "5" return "" diff --git a/integration/hurlfmt/tests_export/url.html b/integration/hurlfmt/tests_export/url.html index cdb2331fb26..419de2ea377 100644 --- a/integration/hurlfmt/tests_export/url.html +++ b/integration/hurlfmt/tests_export/url.html @@ -1,6 +1,5 @@
GET http://localhost:8000/~user
GET http://localhost:8000/%7Euser
GET http://localhost:8000/!$&()*+,;=:@[]
-
-
-
+GET http://localhost:8000?foo={bar}
+
diff --git a/integration/hurlfmt/tests_export/url.hurl b/integration/hurlfmt/tests_export/url.hurl
index 7e4b2cdcb3e..5178930866a 100644
--- a/integration/hurlfmt/tests_export/url.hurl
+++ b/integration/hurlfmt/tests_export/url.hurl
@@ -1,5 +1,4 @@
GET http://localhost:8000/~user
GET http://localhost:8000/%7Euser
GET http://localhost:8000/!$&()*+,;=:@[]
-
-
+GET http://localhost:8000?foo={bar}
diff --git a/integration/hurlfmt/tests_export/url.json b/integration/hurlfmt/tests_export/url.json
index 241856726c0..86b8c02e02c 100644
--- a/integration/hurlfmt/tests_export/url.json
+++ b/integration/hurlfmt/tests_export/url.json
@@ -1 +1 @@
-{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/~user"}},{"request":{"method":"GET","url":"http://localhost:8000/%7Euser"}},{"request":{"method":"GET","url":"http://localhost:8000/!$&()*+,;=:@[]"}}]}
+{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/~user"}},{"request":{"method":"GET","url":"http://localhost:8000/%7Euser"}},{"request":{"method":"GET","url":"http://localhost:8000/!$&()*+,;=:@[]"}},{"request":{"method":"GET","url":"http://localhost:8000?foo={bar}"}}]}
diff --git a/integration/hurlfmt/tests_export/url.lint.hurl b/integration/hurlfmt/tests_export/url.lint.hurl
index 7e4b2cdcb3e..5178930866a 100644
--- a/integration/hurlfmt/tests_export/url.lint.hurl
+++ b/integration/hurlfmt/tests_export/url.lint.hurl
@@ -1,5 +1,4 @@
GET http://localhost:8000/~user
GET http://localhost:8000/%7Euser
GET http://localhost:8000/!$&()*+,;=:@[]
-
-
+GET http://localhost:8000?foo={bar}
diff --git a/packages/hurl_core/src/parser/mod.rs b/packages/hurl_core/src/parser/mod.rs
index 9e0078a217b..2fd4f38a361 100644
--- a/packages/hurl_core/src/parser/mod.rs
+++ b/packages/hurl_core/src/parser/mod.rs
@@ -53,5 +53,4 @@ mod query;
mod sections;
mod string;
mod template;
-mod url;
mod xml;
diff --git a/packages/hurl_core/src/parser/parsers.rs b/packages/hurl_core/src/parser/parsers.rs
index 8272e7402a9..002f96da4d5 100644
--- a/packages/hurl_core/src/parser/parsers.rs
+++ b/packages/hurl_core/src/parser/parsers.rs
@@ -23,10 +23,11 @@ use crate::parser::error::*;
use crate::parser::number::natural;
use crate::parser::primitives::*;
use crate::parser::sections::*;
-use crate::parser::url::url;
use crate::parser::ParseResult;
use crate::reader::Reader;
+use super::string::unquoted_template;
+
pub fn hurl_file(reader: &mut Reader) -> ParseResult