Pregunta

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

¿Fue útil?

Solución

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.

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top