Static: returning 404 for Unix domain sockets.

It's now similar to how attempts to access other non-regular files are handled.
This commit is contained in:
Valentin Bartenev
2019-09-24 15:33:42 +03:00
parent c416933171
commit 514f34144a
2 changed files with 12 additions and 0 deletions

View File

@@ -94,9 +94,20 @@ nxt_http_static_handler(nxt_task_t *task, nxt_http_request_t *r,
if (nxt_slow_path(ret != NXT_OK)) {
switch (f->error) {
/*
* For Unix domain sockets "errno" is set to:
* - ENXIO on Linux;
* - EOPNOTSUPP on *BSD, MacOSX, and Solaris.
*/
case NXT_ENOENT:
case NXT_ENOTDIR:
case NXT_ENAMETOOLONG:
#if (NXT_LINUX)
case NXT_ENXIO:
#else
case NXT_EOPNOTSUPP:
#endif
level = NXT_LOG_ERR;
status = NXT_HTTP_NOT_FOUND;
break;