(request)
| 164 | |
| 165 | @Request.application |
| 166 | def app(request): |
| 167 | # for header |
| 168 | assert request.remote_addr == "192.168.0.1" |
| 169 | # proto, host, port, prefix headers |
| 170 | assert request.url_root == url_root |
| 171 | |
| 172 | urls = url_map.bind_to_environ(request.environ) |
| 173 | parrot_url = urls.build("parrot") |
| 174 | # build includes prefix |
| 175 | assert urls.build("parrot") == "/".join((request.script_root, "parrot")) |
| 176 | # match doesn't include prefix |
| 177 | assert urls.match("/parrot")[0] == "parrot" |
| 178 | |
| 179 | # With autocorrect_location_header enabled, location header will |
| 180 | # start with url_root |
| 181 | return redirect(parrot_url) |
| 182 | |
| 183 | url_map = Map([Rule("/parrot", endpoint="parrot")]) |
| 184 | app = ProxyFix(app, **kwargs) |
nothing calls this directly
no test coverage detected