229
231
location = request.response.getHeader("Location", None)
231
233
accept = request.getHeader("Accept", "application/json")
233
235
# We don't use the URI class because it will raise
234
236
# an exception if the Location contains invalid
235
237
# characters. Invalid characters may indeed be a
236
238
# problem, but let the problem be handled
238
240
(scheme, netloc, path, query, fragment) = (
245
(scheme, netloc, path, query, fragment))
246
uri = urlunsplit((scheme, netloc, path, query, fragment))
246
247
request.response.setHeader("Location", str(uri))