##// END OF EJS Templates
hgweb: fail if an invalid command was supplied in url path (issue4071)...
Anton Shestakov -
r22506:6e1fbcb1 stable
parent child Browse files
Show More
@@ -200,8 +200,6 b' class hgweb(object):'
200 200 # avoid accepting e.g. style parameter as command
201 201 if util.safehasattr(webcommands, cmd):
202 202 req.form['cmd'] = [cmd]
203 else:
204 cmd = ''
205 203
206 204 if cmd == 'static':
207 205 req.form['file'] = ['/'.join(args)]
@@ -122,6 +122,24 b' should give a 400 - bad command'
122 122 error: no such method: spam
123 123 [1]
124 124
125 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT '?cmd=spam'
126 400 no such method: spam
127 [1]
128
129 should give a 400 - bad command as a part of url path (issue4071)
130
131 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'spam'
132 400 no such method: spam
133 [1]
134
135 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'raw-spam'
136 400 no such method: spam
137 [1]
138
139 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'spam/tip/foo'
140 400 no such method: spam
141 [1]
142
125 143 should give a 404 - file does not exist
126 144
127 145 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/bork?style=raw'
@@ -308,7 +326,7 b' stop and restart'
308 326 Test the access/error files are opened in append mode
309 327
310 328 $ python -c "print len(file('access.log').readlines()), 'log lines written'"
311 10 log lines written
329 14 log lines written
312 330
313 331 static file
314 332
General Comments 0
You need to be logged in to leave comments. Login now