logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: HTTP Requests headers
Author
ApacheNewbie



Joined: 07 Feb 2016
Posts: 3
Location: London, UK

PostPosted: Tue 09 Feb '16 0:55    Post subject: HTTP Requests headers Reply with quote

Hi all,

I am wondering if the Apache WebServer is able to cause the client to output certain fields in the HTTP request headers?

Thank you.
Back to top
Anaksunaman



Joined: 19 Dec 2013
Posts: 54

PostPosted: Tue 09 Feb '16 7:49    Post subject: Re: HTTP Requests Reply with quote

You may want to look at mod_headers:

https://httpd.apache.org/docs/trunk/mod/mod_headers.html

However, it seems likely you would need a custom client if you really needed Apache to call the shots.
Back to top
ApacheNewbie



Joined: 07 Feb 2016
Posts: 3
Location: London, UK

PostPosted: Wed 10 Feb '16 10:45    Post subject: Reply with quote

Thanks!

To clarify, I don't want to configure HTTP Response Headers.

What I need is to cause the client (who is accessing my server) to output certain fields in their HTTP Request Headers. Is this possible? Can an Apache Webserver control the client?

Also, what do you mean by "custom client" ?

Thanks a lot!
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 10 Feb '16 20:22    Post subject: Reply with quote

What "fields" do you want the client to send back?
Back to top
ApacheNewbie



Joined: 07 Feb 2016
Posts: 3
Location: London, UK

PostPosted: Thu 11 Feb '16 0:34    Post subject: Reply with quote

glsmith wrote:
What "fields" do you want the client to send back?


For example, X_FORWARDED_FOR and X_WSB_IDENTITY.
Back to top
Anaksunaman



Joined: 19 Dec 2013
Posts: 54

PostPosted: Thu 10 Mar '16 8:36    Post subject: HTTP Requests headers Reply with quote

Quote:
What I need is to cause the client (who is accessing my server) to output certain fields in their HTTP Request Headers.

To clarify, I don't want to configure HTTP Response Headers.

You can "fake" request headers in Apache (i.e have the server insert server-generated values into incoming headers) with mod_headers and RequestHeader. But otherwise, HTTP response headers are the first headers which could hypothetically cause a client to "do" anything (respond to a request).

[Client (ex. Mozilla) --> Request Headers] => [Apache --> Response Headers] => Client (ex. Mozilla)

Since the client (ex. Firefox) initiates the request to the server (ex. Apache) there is no way to "force" it to initially send anything other than what it is programmed to send. The only header which is required in an HTTP/1.1 request is "Host". Therefore, any additional headers which are sent are completely up to the client. That means a valid request could be as little as:

GET / HTTP/1.1
Host: localhost
[CLRF]

to return valid data from Apache.

Quote:
"What "fields" do you want the client to send back?"
For example, X_FORWARDED_FOR and X_WSB_IDENTITY.


These in particular are non-standard headers and may not be used by clients in any case. That is, there could be no data to return (even by "force") since the clients would not generate it (though, as mentioned, it could be "faked" by Apache).

Quote:
Also, what do you mean by "custom client" ?


I mean develop a "client" yourself e.g program something that will output particular headers to Apache on its own or in response to particular headers (or what have you) that Apache sends.
Back to top


Reply to topic   Topic: HTTP Requests headers View previous topic :: View next topic
Post new topic   Forum Index -> Apache