Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Request Header and Forward to another application

I am writing a Java based Web application, which, in the actual production environment would be front-ended by another application which would set certain HTTP request headers before the request hits my application.

However, in the development environment I do not have the front-ending application, for which I need to create a mock web application that simulates the same behavior. i.e. this mock application should set the request headers and redirect or forward or whatever that I do not know :) to a certain page in my application.

How can I accomplish this?

like image 544
Shyam Avatar asked Nov 27 '22 20:11

Shyam


2 Answers

The following articles may help you:


P.S.
I am sorry I provided only links, that was one of my early answer on SO ))

like image 157
informatik01 Avatar answered Dec 04 '22 11:12

informatik01


In case you don't want to modify your code as suggested by @user1979427 you can use a proxy server to modify headers or add headers on the fly.

For example in Apache HTTPD you would add something like below and proxy the

Header add HEADER "HEADERVALUE"
RequestHeader set HEADER "HEADERVALUE"   

Refer to HTTPD doc

like image 32
ch4nd4n Avatar answered Dec 04 '22 12:12

ch4nd4n