mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-23 09:44:22 +03:00
Support IPv4/IPv6 address for proxy option
This commit is contained in:
parent
cec0fb7160
commit
cae200a77c
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -Eeuo pipefail
|
||||
hurl tests_ok/proxy.hurl --proxy localhost:3128 --verbose
|
||||
hurl tests_ok/proxy.hurl --proxy 127.0.0.1:3128 --verbose
|
||||
|
||||
|
@ -5,5 +5,11 @@
|
||||
<span class="line"><span class="string">proxy</span>: <span class="string">localhost:3128</span></span>
|
||||
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
|
||||
<span class="line"><span class="string">From-Proxy</span>: <span class="string">Hello</span></span>
|
||||
</span></span><span class="line"></span>
|
||||
</code></pre>
|
||||
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
||||
<span class="line"></span><span class="comment"># Using ipv4</span>
|
||||
<span class="line"><span class="method">GET</span> <span class="url">http://127.0.0.1:8000/proxy</span></span>
|
||||
<span class="line"><span class="section-header">[Options]</span></span>
|
||||
<span class="line"><span class="string">proxy</span>: <span class="string">127.0.0.1:3128</span></span>
|
||||
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
|
||||
<span class="line"><span class="string">From-Proxy</span>: <span class="string">Hello</span></span>
|
||||
</span></span></code></pre>
|
||||
|
@ -6,3 +6,9 @@ proxy: localhost:3128
|
||||
HTTP 200
|
||||
From-Proxy: Hello
|
||||
|
||||
# Using ipv4
|
||||
GET http://127.0.0.1:8000/proxy
|
||||
[Options]
|
||||
proxy: 127.0.0.1:3128
|
||||
HTTP 200
|
||||
From-Proxy: Hello
|
||||
|
@ -1 +1 @@
|
||||
{"entries":[{"request":{"method":"GET","url":"http://127.0.0.1:8000/proxy","options":[{"name":"proxy","value":"localhost:3128"}]},"response":{"status":200,"headers":[{"name":"From-Proxy","value":"Hello"}]}}]}
|
||||
{"entries":[{"request":{"method":"GET","url":"http://127.0.0.1:8000/proxy","options":[{"name":"proxy","value":"localhost:3128"}]},"response":{"status":200,"headers":[{"name":"From-Proxy","value":"Hello"}]}},{"request":{"method":"GET","url":"http://127.0.0.1:8000/proxy","options":[{"name":"proxy","value":"127.0.0.1:3128"}]},"response":{"status":200,"headers":[{"name":"From-Proxy","value":"Hello"}]}}]}
|
||||
|
@ -484,7 +484,8 @@ fn option_very_verbose(reader: &mut Reader) -> ParseResult<'static, OptionKind>
|
||||
|
||||
fn proxy(reader: &mut Reader) -> ParseResult<'static, String> {
|
||||
let start = reader.state.clone();
|
||||
let name = reader.read_while(|c| c.is_alphanumeric() || *c == ':');
|
||||
let name = reader
|
||||
.read_while(|c| c.is_alphanumeric() || *c == ':' || *c == '.' || *c == '[' || *c == ']');
|
||||
if name.is_empty() {
|
||||
return Err(Error {
|
||||
pos: start.pos,
|
||||
|
Loading…
Reference in New Issue
Block a user