j8a icon indicating copy to clipboard operation
j8a copied to clipboard

Allow passthrough of upstream 500 responses for development environments

Open simonmittag opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. J8a hides HTTP response body of upstream 500 responses and replaces it with a standard "502 bad gateway" message. This currently cannot be disabled.

Describe the solution you'd like Keep the 502 bad gateway response code, but add a config flag under "downstream". "detailedUpstream50x", which will include the raw upstream response. This should be a JSON property on the response and needs to be encoded.

{
"j8a":"Achuta!",
"ServerID":"f05917d6",
"Version":"v0.9.0",
"Code":502,
"Message":"bad gateway",
"UpResCode":"${insert upstream HTTP response code here }",
"UpResBody":"${insert upstream HTTP response body here }",
}

disable this setting by default, not recommended for production.

simonmittag avatar Nov 11 '21 04:11 simonmittag

cc @petelah, @dave-sims

simonmittag avatar Nov 11 '21 04:11 simonmittag

@simonmittag great feature request! This will be very useful.

petelah avatar Nov 11 '21 04:11 petelah