Forum

Add X-Requested-With and X-Requested-Handler HTTP Headers (patch inclu

Raphaël HUCK
15 December 2008, 19:55
Hi, the following patch adds X-Requested-With and X-Requested-Handler HTTP Headers which are very useful, especially when dealing with Ajax

--- hiawatha-6.10.orig/envir.c 2008-10-01 00:08:03.000000000 +0200
+++ hiawatha-6.10/envir.c 2008-12-15 18:34:51.425460735 +0100
@@ -189,6 +189,8 @@ void set_environment(t_session *session,
headerfield_to_environment(session, fcgi_buffer, "User-Agent:", "HTTP_USER_AGENT");
headerfield_to_environment(session, fcgi_buffer, "Via:", "HTTP_VIA");
headerfield_to_environment(session, fcgi_buffer, "X-Forwarded-For:", "HTTP_X_FORWARDED_FOR");
+ headerfield_to_environment(session, fcgi_buffer, "X-Requested-With:", "HTTP_X_REQUESTED_WITH");
+ headerfield_to_environment(session, fcgi_buffer, "X-Requested-Handler:", "HTTP_X_REQUESTED_HANDLER");

if (session->path_info != NULL) {
add_to_environment(fcgi_buffer, "PATH_INFO", session->path_info);


Thanks!
Hugo Leisink
16 December 2008, 02:14
Thanks! I will look into it.
Hugo Leisink
17 December 2008, 11:41
I've added them to the source code. It will be available in 6.11
Rapha?HUCK
17 December 2008, 18:15
Thanks a lot Hugo!
This topic has been closed.