You are viewing a plain text version of this content. The canonical link for it is here.
Posted to devnull@infra.apache.org by "mal (GitHub)" <gi...@apache.org> on 2018/08/21 23:26:01 UTC

[GitHub] [trafficserver] mal opened issue #4143: set-destination SCHEME doesn't work with valid dynamic values

I'm trying to alter the scheme of a request based on a custom header, thus:

```
cond %{READ_REQUEST_HDR_HOOK}
cond %{HEADER:X-ATS-Scheme} /http/
set-destination SCHEME %{CLIENT-HEADER:X-ATS-Scheme}
```

Unfortunately making a request:
```
$ http_proxy=http://traffic:8888 curl -i google.com -H 'X-ATS-Scheme: http'
```

Results in a `HTTP/1.1 400 Unsupported URL Scheme`. However changing the final line to be:

```
set-destination QUERY %{HEADER:X-ATS-Scheme}
```

Happily rewrites the request to `http://google.com/?http`. And hardcoding the scheme in the `set-destination`:

```
set-destination SCHEME http
```

Works as I'd hoped the dynamic version would. It seems like this should be possible but is perhaps a bug in that it doesn't recognise when the dynamic value is a valid scheme?

[ Full content available at: https://github.com/apache/trafficserver/issues/4143 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org

[GitHub] [trafficserver] mlibbey commented on issue #4143: set-destination SCHEME doesn't work with valid dynamic values

Posted by "mlibbey (GitHub)" <gi...@apache.org>.
Know its not exactly what you are after, but what about 
cond %{READ_REQUEST_HDR_HOOK} [AND]
cond %{HEADER:X-ATS-Scheme}="http"
set-destination SCHEME http

cond %{READ_REQUEST_HDR_HOOK} [AND]
cond %{HEADER:X-ATS-Scheme}="https"
set-destination SCHEME https


[ Full content available at: https://github.com/apache/trafficserver/issues/4143 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org

[GitHub] [trafficserver] mal commented on issue #4143: set-destination SCHEME doesn't work with valid dynamic values

Posted by "mal (GitHub)" <gi...@apache.org>.
Thanks, that's also the resolution I came to too in this case! 🙂

It just seemed odd that it wasn't possible to use the dynamic approach so filed this in case it was something that needed fixing. It's certainly not blocking anything and the current solution (above) has been working well for a few months. Please feel free to close the issue if this is considered "working as intended" but if that is the case I'd encourage a docs update to make that a bit clearer. 👍

[ Full content available at: https://github.com/apache/trafficserver/issues/4143 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org