mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-12 19:33:03 +00:00
Made header parsing case insensitive
This commit is contained in:
parent
1e5e82b033
commit
927ffac38c
18
src/elogd.c
18
src/elogd.c
@ -28723,7 +28723,7 @@ int process_http_request(const char *request, int i_conn)
|
|||||||
content_length = 0;
|
content_length = 0;
|
||||||
|
|
||||||
/* extract cookies */
|
/* extract cookies */
|
||||||
if ((p = strstr(request, "Cookie:")) != NULL) {
|
if ((p = strcasestr(request, "Cookie:")) != NULL) {
|
||||||
p += 6;
|
p += 6;
|
||||||
do {
|
do {
|
||||||
p++;
|
p++;
|
||||||
@ -28765,7 +28765,7 @@ int process_http_request(const char *request, int i_conn)
|
|||||||
|
|
||||||
/* extract referer */
|
/* extract referer */
|
||||||
referer[0] = 0;
|
referer[0] = 0;
|
||||||
if ((p = strstr(request, "Referer:")) != NULL) {
|
if ((p = strcasestr(request, "Referer:")) != NULL) {
|
||||||
p += 9;
|
p += 9;
|
||||||
while (*p && *p == ' ')
|
while (*p && *p == ' ')
|
||||||
p++;
|
p++;
|
||||||
@ -28782,7 +28782,7 @@ int process_http_request(const char *request, int i_conn)
|
|||||||
|
|
||||||
/* extract browser */
|
/* extract browser */
|
||||||
browser[0] = 0;
|
browser[0] = 0;
|
||||||
if ((p = strstr(request, "User-Agent:")) != NULL) {
|
if ((p = strcasestr(request, "User-Agent:")) != NULL) {
|
||||||
p += 11;
|
p += 11;
|
||||||
while (*p && *p == ' ')
|
while (*p && *p == ' ')
|
||||||
p++;
|
p++;
|
||||||
@ -28793,7 +28793,7 @@ int process_http_request(const char *request, int i_conn)
|
|||||||
|
|
||||||
/* extract host */
|
/* extract host */
|
||||||
http_host[0] = 0;
|
http_host[0] = 0;
|
||||||
if ((p = strstr(request, "Host:")) != NULL) {
|
if ((p = strcasestr(request, "Host:")) != NULL) {
|
||||||
p += 5;
|
p += 5;
|
||||||
while (*p && *p == ' ')
|
while (*p && *p == ' ')
|
||||||
p++;
|
p++;
|
||||||
@ -28803,7 +28803,7 @@ int process_http_request(const char *request, int i_conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* extract X-Forwarded-Host, overwrite "Host:" if found */
|
/* extract X-Forwarded-Host, overwrite "Host:" if found */
|
||||||
if ((p = strstr(request, "X-Forwarded-Host:")) != NULL) {
|
if ((p = strcasestr(request, "X-Forwarded-Host:")) != NULL) {
|
||||||
p += 17;
|
p += 17;
|
||||||
while (*p && *p == ' ')
|
while (*p && *p == ' ')
|
||||||
p++;
|
p++;
|
||||||
@ -28814,7 +28814,7 @@ int process_http_request(const char *request, int i_conn)
|
|||||||
|
|
||||||
/* extract X-Forwarded-User into http_user if Authentication==Webserver */
|
/* extract X-Forwarded-User into http_user if Authentication==Webserver */
|
||||||
http_user[0] = 0;
|
http_user[0] = 0;
|
||||||
if ((p = strstr(request, "X-Forwarded-User:")) != NULL) {
|
if ((p = strcasestr(request, "X-Forwarded-User:")) != NULL) {
|
||||||
p += 17;
|
p += 17;
|
||||||
while (*p && *p == ' ')
|
while (*p && *p == ' ')
|
||||||
p++;
|
p++;
|
||||||
@ -28824,7 +28824,7 @@ int process_http_request(const char *request, int i_conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* extract "X-Forwarded-For:" */
|
/* extract "X-Forwarded-For:" */
|
||||||
if ((p = strstr(request, "X-Forwarded-For:")) != NULL) {
|
if ((p = strcasestr(request, "X-Forwarded-For:")) != NULL) {
|
||||||
p += 16;
|
p += 16;
|
||||||
while (*p && *p == ' ')
|
while (*p && *p == ' ')
|
||||||
p++;
|
p++;
|
||||||
@ -28866,9 +28866,7 @@ int process_http_request(const char *request, int i_conn)
|
|||||||
return_length = 0;
|
return_length = 0;
|
||||||
|
|
||||||
/* check for Keep-alive */
|
/* check for Keep-alive */
|
||||||
if (strstr(request, "Keep-Alive") != NULL && use_keepalive)
|
if (strcasestr(request, "Keep-Alive") != NULL && use_keepalive)
|
||||||
keep_alive = TRUE;
|
|
||||||
if (strstr(request, "keep-alive") != NULL && use_keepalive)
|
|
||||||
keep_alive = TRUE;
|
keep_alive = TRUE;
|
||||||
|
|
||||||
/* extract logbook */
|
/* extract logbook */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user