##// END OF EJS Templates
hgweb: protocol requests are processed immediately...
Dirkjan Ochtman -
r6777:44c51574 default
parent child Browse files
Show More
@@ -89,6 +89,16 b' class hgweb(object):'
89
89
90 self.refresh()
90 self.refresh()
91
91
92 # process this if it's a protocol request
93 # protocol bits don't need to create any URLs
94 # and the clients always use the old URL structure
95
96 cmd = req.form.get('cmd', [''])[0]
97 if cmd and cmd in protocol.__all__:
98 method = getattr(protocol, cmd)
99 method(self, req)
100 return
101
92 # work with CGI variables to create coherent structure
102 # work with CGI variables to create coherent structure
93 # use SCRIPT_NAME, PATH_INFO and QUERY_STRING as well as our REPO_NAME
103 # use SCRIPT_NAME, PATH_INFO and QUERY_STRING as well as our REPO_NAME
94
104
@@ -120,8 +130,10 b' class hgweb(object):'
120 cmd = cmd[style+1:]
130 cmd = cmd[style+1:]
121
131
122 # avoid accepting e.g. style parameter as command
132 # avoid accepting e.g. style parameter as command
123 if hasattr(webcommands, cmd) or hasattr(protocol, cmd):
133 if hasattr(webcommands, cmd):
124 req.form['cmd'] = [cmd]
134 req.form['cmd'] = [cmd]
135 else:
136 cmd = ''
125
137
126 if args and args[0]:
138 if args and args[0]:
127 node = args.pop(0)
139 node = args.pop(0)
@@ -139,14 +151,6 b' class hgweb(object):'
139 req.form['node'] = [fn[:-len(ext)]]
151 req.form['node'] = [fn[:-len(ext)]]
140 req.form['type'] = [type_]
152 req.form['type'] = [type_]
141
153
142 # process this if it's a protocol request
143
144 cmd = req.form.get('cmd', [''])[0]
145 if cmd in protocol.__all__:
146 method = getattr(protocol, cmd)
147 method(self, req)
148 return
149
150 # process the web interface request
154 # process the web interface request
151
155
152 try:
156 try:
@@ -36,19 +36,19 b' echo % Overviews'
36 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/summary/?style=gitweb' | sed "s/[0-9]* years ago/long ago/g"
36 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/summary/?style=gitweb' | sed "s/[0-9]* years ago/long ago/g"
37
37
38 echo % capabilities
38 echo % capabilities
39 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/capabilities'
39 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'
40 echo % heads
40 echo % heads
41 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/heads'
41 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=heads'
42 echo % lookup
42 echo % lookup
43 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/lookup/1'
43 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=lookup&node=1'
44 echo % branches
44 echo % branches
45 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/branches'
45 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=branches'
46 echo % changegroup
46 echo % changegroup
47 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/changegroup'
47 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup'
48 echo % stream_out
48 echo % stream_out
49 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/stream_out'
49 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=stream_out'
50 echo % failing unbundle, requires POST request
50 echo % failing unbundle, requires POST request
51 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/unbundle'
51 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=unbundle'
52
52
53 echo % Static files
53 echo % Static files
54 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/static/style.css'
54 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/static/style.css'
General Comments 0
You need to be logged in to leave comments. Login now