[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Adding extra fields to request headers

Pradeepta Swain

2/5/2008 6:06:00 AM

how can i add extra fields to request headers ?
--
Posted via http://www.ruby-....

3 Answers

Clifford Heath

2/5/2008 6:10:00 AM

0

Pradeepta Swain wrote:
> how can i add extra fields to request headers ?

Please ask this in a Rails forum - this is Ruby here, not Rails.

Rha

2/5/2008 8:47:00 AM

0

If you don't know the answer, it is absurd and ignorant to answer with
a non-answer.

Did you know you can do CGI on ruby? did you know that request headers
are a web server concept and language agnostic?

Besides, ruby on rails IS ruby in the end.

ANSWER:
It depends on the web server you're using, but I will assume you're
using apache, so you use something like this in httpd.conf or
apache.conf:

RequestHeader add X-Your-Variable-Name 'The Value'

For example to use it to pass the logged on user name for a Windows
domain, something like this might work:


<VirtualHost *:82>
ServerName yourwinserver.com
ServerAlias www.yourwinserver.com

RewriteLog logs/myapp_rewrite_log
RewriteLogLevel 9

<Location />
AuthName "Authenticate to MyApp"
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIOmitDomain On
Require valid-user

RewriteEngine On
RewriteCond %{IS_SUBREQ} ^false$
RewriteCond %{LA-U:REMOTE_USER} (.*)
RewriteRule . - [E=RU:%1]
RequestHeader add X-Remote-User %{RU}e

</Location>

ProxyPass / http://www.yourwebserver...
ProxyPassReverse / http://www.yourwebserve...
ProxyPreserveHost on

</VirtualHost>

Hope this helps. Have a good day!




On Tue, 05 Feb 2008 17:10:21 +1100, Clifford Heath
<no@spam.please.net> wrote:

>Pradeepta Swain wrote:
>> how can i add extra fields to request headers ?
>
>Please ask this in a Rails forum - this is Ruby here, not Rails.

Clifford Heath

2/5/2008 9:15:00 AM

0

Rha wrote:
> If you don't know the answer, it is absurd and ignorant to answer with
> a non-answer.

No. The OP is almost certainly using Rails - or they would have
said what they are using - and your answer provides no help at all.

> Did you know you can do CGI on ruby? did you know that request headers
> are a web server concept and language agnostic?

Yes. And I could have given five answers, but in the final analysis,
it's more helpful to direct the OP to where they can get help with
the framework they're using.