Index: trunk/extensions/SwiftMedia/wmf/rewrite.py |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | # just return the open file handle, and webob would take care of reading from |
17 | 17 | # the socket and returning the data to the client machine. If we were only |
18 | 18 | # opening a URL and writing its contents out to Swift, we could call |
19 | | -# put_object with the file handle and it would read take care of reading from |
| 19 | +# put_object with the file handle and it would take care of reading from |
20 | 20 | # the socket and writing the data to the Swift proxy. |
21 | 21 | # We have to do both at the same time. This requires that we hand over a class which |
22 | 22 | # is an iterable which reads, writes one copy to Swift (using put_object_chunked), and |
— | — | @@ -153,13 +153,15 @@ |
154 | 154 | |
155 | 155 | # keep a copy of the original request so we can ask the scalers for it |
156 | 156 | reqorig = req.copy() |
157 | | - # match these two URL forms, with the wikipedia, commons, and the rest |
158 | | - # going into groups. |
| 157 | + # match these two URL forms (source files and thumbnails): |
| 158 | + # http://upload.wikimedia.org/<site>/<lang>/.* |
| 159 | + # http://upload.wikimedia.org/<site>/<lang>/thumb/.* |
| 160 | + # example: |
159 | 161 | # http://upload.wikimedia.org/wikipedia/commons/a/aa/000_Finlanda_harta.PNG |
160 | 162 | # http://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/000_Finlanda_harta.PNG/75px-000_Finlanda_harta.PNG |
161 | 163 | match = re.match(r'/(.*?)/(.*?)/(.*)', req.path) |
162 | 164 | if match: |
163 | | - # Our target URL is as follows: |
| 165 | + # Our target URL is as follows (example): |
164 | 166 | # https://alsted.wikimedia.org:8080/v1/AUTH_6790933748e741268babd69804c6298b/wikipedia-en/2/25/Machinesmith.png |
165 | 167 | |
166 | 168 | # quote slashes in the container name |