Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Support the addition of a custom header to the client request #123

Open
gnotaras opened this issue Sep 23, 2012 · 1 comment
Open

Support the addition of a custom header to the client request #123

gnotaras opened this issue Sep 23, 2012 · 1 comment

Comments

@gnotaras
Copy link

stud should support the addition of custom headers to the request, so that the backend server have a trusted way to determine whether the request has actually passed through stud or not.

For instance, I'd add a secret key as a value to a custom header in the stud configuration.

X-Secure-Conn-Key: 1234567890

Then, in the backend server I'd check for the existence of my secret header and key and in turn notify the application that the client has connected over a secure channel.

Eg, in apache, the header could be checked and, if the key matched, the variable HTTPS would be set to on (most web applications use such a variable to determine if the client connection was secure):

SetEnvIf X-Secure-Conn-Key 1234567890 HTTPS=on

I think it would be a useful feature.

PS: My use case is stud<->varnish<->apache<->fastcgi_app

@kvdveer
Copy link

kvdveer commented Jul 11, 2013

If you trust the host where stud is running, you may be able to add the secure key in varnish, by checking the source of the request:

sub vcl_recv {
if (client.ip ~ stud_hosts ) {
set req.http.x-secure-conn-key = "1234567890 https=on";
}
else {
set req.http.x-secure-conn-key = "1234567890 https=off";
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants