Question

Please consider the below request from apache access log.

119.63.193.131 - - [03/Oct/2013:19:22:19 +0000] "HEAD /blah/blahblah/ HTTP/1.1" 301 - "-" "\"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)\""

Does this request comply with the RFC / standard?

Would Apache pass malformed HEAD requests to PHP?

My configuration is Apache 2.2.15, mod_fcgid 2.3.7, PHP 5.3.3, Linux 2.6.32.60-40 x64, CentOS 6.4

Was it helpful?

Solution

I see nothing obviously wrong about the request in that log entry. It has an unusual user agent (with double quotes in it), but that doesn't make it malformed - it's perfectly valid, and Apache would certainly pass it on to PHP.

OTHER TIPS

I have done fair few RESTful APIs with PHP and apache; never came across any such issues. Best would be to isolate the part that you want to doubly make sure to be working, which in your case is PHP and apache. So put together a basic PHP script that would dump $_SERVER and apache_request_headers() (may be other global variables) which would give you enough clue as to whether it is working or not. use curl -I option for a command line HTTP client; you may also use -v option to see exactly what happens from the client's perspective.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top