~moody/rc-gemd

rc-gemd/handlers/static-or-index -rwxr-xr-x 206 bytes
8b3ea55d — Jacob Moody path name should be cleaned, prevents $fs_root escape 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
#!/bin/rc
full_path=`{echo $"fs_root^$"location | urlencode -d}
full_path=$"full_path
if(~ $"location */)
	exec dir-index
if(test -d $full_path){
	location=$location^'/'
	exec dir-index
}
exec serve-static