diff options
author | Valentin Bartenev <vbart@nginx.com> | 2019-09-24 15:33:42 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2019-09-24 15:33:42 +0300 |
commit | 514f34144a491832db1647c84a7271120ba7e7d6 (patch) | |
tree | 44565d310f670ab5ea8282109809a1665a0d2269 /src/nxt_http_static.c | |
parent | c416933171810a85b4e4e8fa6778820e1746b003 (diff) | |
download | unit-514f34144a491832db1647c84a7271120ba7e7d6.tar.gz unit-514f34144a491832db1647c84a7271120ba7e7d6.tar.bz2 |
Static: returning 404 for Unix domain sockets.
It's now similar to how attempts to access other non-regular files are handled.
Diffstat (limited to 'src/nxt_http_static.c')
-rw-r--r-- | src/nxt_http_static.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nxt_http_static.c b/src/nxt_http_static.c index 4679af5b..48a989cf 100644 --- a/src/nxt_http_static.c +++ b/src/nxt_http_static.c @@ -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; |