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:
@@ -16,6 +16,7 @@ typedef int nxt_err_t;
|
||||
#define NXT_ENOPATH ENOENT
|
||||
#define NXT_ESRCH ESRCH
|
||||
#define NXT_EINTR EINTR
|
||||
#define NXT_ENXIO ENXIO
|
||||
#define NXT_ECHILD ECHILD
|
||||
#define NXT_ENOMEM ENOMEM
|
||||
#define NXT_EACCES EACCES
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user