Re: Control / Modify the HTTP Status Line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi matt and lbutlr
Thanks for the response.

I guess I should add few pieces of information.
The client is one SaaS and the backend is another SaaS. The backend returns 302 which is right but the client consider anything which is not 2xx as error which cause it to retry.

Therefore I must "hack" or stitch it with a proxy. I am using mod_proxy.
My other alternative is to use other software than httpd to stitch those two services and show 200 instead of the 302.

The solution mentioned in stackoverflow will not work for 302 response as I cannot set error page for such non-error response codes.

The solution with rewrite won't work neither as I need to alter the response and not the request.


On Wed, May 22, 2019, 10:37 PM Muggeridge, Matt <matt.muggeridge2@xxxxxxx> wrote:

With a little googling, this technique looks promising… https://stackoverflow.com/questions/15083481/how-can-i-replace-apache-http-code-404-to-200

 

  • As I cannot alter the backend behaviour

 

Yet, you talk about using mod_substitute and mod_header to alter the server’s behaviour.  If the 302 responses are not valid, then hunt down and fix/remove the ‘redirect’ configuration options in either a .htaccess or some other configuration file.

 

Matt.

 

From: Shmuel Krakower <shmulikk@xxxxxxxxx>
Sent: Thursday, 23 May 2019 4:00 AM
To: users@xxxxxxxxxxxxxxxx
Subject: Control / Modify the HTTP Status Line

 

Hello,

This is my first message on this user list, hope that's the right place for my question.

 

I am using Apache for proxying a backend server.

The backend server may return, in some occaisons, a 302 response code for successful requests.

As I cannot alter the backend behavior nor the client's to consider such 302 responses as successful, I am looking for a way to manipulate the response code on Apache.

 

While going through the options in and trying ways to alter data which is sent back to clients I found two:

1. mod_substitute - to manipulate respose body.

2. mod_header - to manipulate respose headers.

 

The problem is that the HTTP Status Line (the very first line returned by apache) cannot be altered by neither of these modules.

I was also trying to set the response code in various response headers but none seem to make any affect on the Status Line contents.

 

Does anyone know of a way to manipulate the HTTP Status Line or how to internal process of apache works to determine the Status Line (maybe this way I can cause it to generate a different status line).

 

Thanks,

Shmuel Krakower.


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux