Merge branch 'master' of github.com:BillyRuffian/roda-proxy

This commit is contained in:
Nigel Brookes-Thomas 2020-03-26 11:36:45 +00:00
commit 848d5e6714
1 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ route do |r|
end
```
The proxy will always be invoked. Headers and body are passed through unmodified in both directions with the exception of `Host` which is rewritten to match the target.
The proxy will always be invoked. Headers and body are passed through unmodified in both directions with the exception of `Host` which is rewritten to match the target and `Via` which is created (or appended to if it already exists) to indicate the proxy path.
Also provided is a conditional proxy:
@ -82,7 +82,7 @@ route do |r|
end
```
With `proxy_when` the first optional parameter expects a truthy value or a block / lambda that returns a truthy value. This must be equivalent to `true` for the proxying to occur. The optional probability is a float between 0 and 1 indicating the probability that proxying will happen. Both paramters can be used alone or in isolation.
With `proxy_when` the first optional parameter expects a truthy value or a block / lambda that returns a truthy value. This must be equivalent to `true` for the proxying to occur. The optional probability is a float between 0 and 1 indicating the probability that proxying will happen. Both parameters can be used alone or in isolation.
If and only if proxying does not occur will the block be evaluated and return to Roda for rendering.