# HG changeset patch # User Olaf Wintermann # Date 1667318064 -3600 # Node ID 162f122b96a1b61753e6874f87114d6b13effb95 # Parent e0e0754efd4687b559d92226694c1b8cc45b286d add vfs support to dir_redirect diff -r e0e0754efd46 -r 162f122b96a1 src/server/safs/pathcheck.c --- a/src/server/safs/pathcheck.c Tue Nov 01 16:53:11 2022 +0100 +++ b/src/server/safs/pathcheck.c Tue Nov 01 16:54:24 2022 +0100 @@ -184,14 +184,15 @@ int dir_redirect(pblock *pb, Session *sn, Request *rq) { char *path = pblock_findkeyval(pb_key_path, rq->vars); - // TODO: VFS support + VFSContext *vfs = vfs_request_context(sn, rq); struct stat s; - if(stat(path, &s) != 0) { + if(vfs_stat(vfs, path, &s) != 0) { return REQ_NOACTION; } // TODO: remove code duplication (service.c) + // TODO: make response code configurable if(S_ISDIR(s.st_mode) && path[strlen(path)-1] != '/') { pblock_nvinsert("content-length", "0", rq->srvhdrs); pblock_removekey(pb_key_content_type, rq->srvhdrs);