~moody/rc-gemd

ref: 155f3d40db228d89bd4a400f81920d7eeb241af7 rc-gemd/rc-gemd -rwxr-xr-x 424 bytes
155f3d40Moody Make error codes more closely match spec 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/rc
rc_gemd_dir=/rc/bin/rc-gemd
path=(/bin $rc_gemd_dir/handlers)
cr=

url=`{sed 's/'$cr'//;1q'}
if(~ $url *://*){
	scheme=`{echo $url | sed 's,://.*,,g'}
	url=`{echo $url | sed 's,'^$scheme^'://,,'}
}
if not
	scheme='gemini://'

server_name=`{echo $url | sed 's,/.*,,'}
location=`{echo $url | sed 's,[a-zA-Z0-9.:]+/?,/,'}

echo request from `{sed 's/!.*//' $net/remote} to $url >[1=2]

. $rc_gemd_dir/select-handler