mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Extract and use 'X-Forwarded-Host:'
SVN revision: 921
This commit is contained in:
parent
3c35c11950
commit
cb11e96345
13
src/elogd.c
13
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.356 2004/06/23 08:00:26 midas
|
||||||
|
Extract and use 'X-Forwarded-Host:'
|
||||||
|
|
||||||
Revision 1.355 2004/06/23 07:41:34 midas
|
Revision 1.355 2004/06/23 07:41:34 midas
|
||||||
Added _cmdline in redirection
|
Added _cmdline in redirection
|
||||||
|
|
||||||
@ -17991,6 +17994,16 @@ void server_loop(int tcp_port, int daemon)
|
|||||||
*strchr(http_host, '\r') = 0;
|
*strchr(http_host, '\r') = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* extract X-Forwarded-Host, overwrite "Host:" if found */
|
||||||
|
if ((p = strstr(net_buffer, "X-Forwarded-Host:")) != NULL) {
|
||||||
|
p += 5;
|
||||||
|
while (*p && *p == ' ')
|
||||||
|
p++;
|
||||||
|
strlcpy(http_host, p, sizeof(http_host));
|
||||||
|
if (strchr(http_host, '\r'))
|
||||||
|
*strchr(http_host, '\r') = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* extract "X-Forwarded-For:" */
|
/* extract "X-Forwarded-For:" */
|
||||||
if ((p = strstr(net_buffer, "X-Forwarded-For:")) != NULL) {
|
if ((p = strstr(net_buffer, "X-Forwarded-For:")) != NULL) {
|
||||||
p += 16;
|
p += 16;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user