From b259b07e460df8380b934668e3767da740044136 Mon Sep 17 00:00:00 2001 From: stsp Date: Tue, 6 Jan 2015 17:55:28 +0000 Subject: [PATCH] Make httpd return "404 not found" if an intermediate component of a requested file path does not exist rather than returning "500 internal server error". ok reyk --- usr.sbin/httpd/server_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/httpd/server_file.c b/usr.sbin/httpd/server_file.c index 6167bdb2304..d1ccce7cadf 100644 --- a/usr.sbin/httpd/server_file.c +++ b/usr.sbin/httpd/server_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_file.c,v 1.44 2015/01/04 22:23:58 chrisz Exp $ */ +/* $OpenBSD: server_file.c,v 1.45 2015/01/06 17:55:28 stsp Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter @@ -134,6 +134,7 @@ server_file_access(struct httpd *env, struct client *clt, fail: switch (errno) { case ENOENT: + case ENOTDIR: return (404); case EACCES: return (403); -- 2.20.1