Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add http-response configuration keys #915

Merged
merged 1 commit into from
Apr 6, 2022
Merged

Conversation

jcmoraisjr
Copy link
Owner

@jcmoraisjr jcmoraisjr commented Apr 5, 2022

Add option to overwrite any response payload issued by haproxy, or configured by haproxy ingress. This update might lead to backward incompatibility if a deployment already customize the Lua script with the haproxy ingress generated responses.

We're using two approaches here. One of them is implementing services in Lua, this gives some flexibility to issue codes that haproxy doesn't support like 495. The other approach is using HAProxy errorfile, which is the proper way to overwrite responses generated internally by HAProxy and hard to move to a Lua script, like 500 or 503. All of them however uses the same interface, so users don't need to bother if the overwrite will be made via errorfile or Lua script.

The implementation was also made in such a way that a response code can be changed, this is useful in scenarios that the client should be redirected via 302 Found if there isn't a server available (503) or if the request is denied (403).

@jcmoraisjr
Copy link
Owner Author

#823

Add option to overwrite any response payload issued by haproxy, or
configured by haproxy ingress. This update might lead to backward
incompatibility if a deployment already customize the Lua script with
the haproxy ingress generated responses.

We're using two approaches here. One of them is implementing services in
Lua, this gives some flexibility to issue codes that haproxy doesn't
support like 495. The other approach is using HAProxy errorfile, which
is the proper way to overwrite responses generated internally by HAProxy
and hard to move to a Lua script, like 500 or 503. All of them however
uses the same interface, so users don't need to bother if the overwrite
will be made via errorfile or Lua script.

The implementation was also made in such a way that a response code can
be changed, this is useful in scenarios that the client should be
redirected via `302 Found` if there isn't a server available (503) or
if the request is denied (403).
@jcmoraisjr jcmoraisjr merged commit 2244e87 into master Apr 6, 2022
@jcmoraisjr jcmoraisjr deleted the jm-http-responses branch April 6, 2022 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant