Filtered request gets 404 status instead of 403

andreas

Well-Known Member
#1
Hi,

I have set up a simple global request filter based on a user agent. For static files this works correctly:

$ lynx -mime-header -useragent="Microsoft URL Control" http://www.ruby-forum.com/robots.txt | grep HTTP/1.
Warning: User-Agent string does not contain "Lynx" or "L_y_n_x"!
HTTP/1.0 403 Forbidden

When I access an URL that is handled by a Rails application, the return code is 404 instead of 403:

$ lynx -mime-header -useragent="Microsoft URL Control" http://www.ruby-forum.com/ | grep HTTP/1.
Warning: User-Agent string does not contain "Lynx" or "L_y_n_x"!
HTTP/1.0 404 Not Found

Andreas
 
Top