def http_error_301(self, req, fp, code, msg, headers): new_url = req.get_full_url() result = HTTPRedirectHandler.http_error_301( self, req, fp, code, msg, headers) if not hasattr(result, "redirected_via"): result.redirected_via = [] result.redirected_via.append(new_url)
def http_error_301(self, req, res, code, msg, headers): '''Update location and filter non-GET request before calling parent implementation. ''' method = req.get_method() resource = req.resource # Update resource location if 'location' in headers: resource.location = headers['location'] # Bail unless method is GET if method != 'GET': return res # Let parent handle the rest return HTTPRedirectHandler.http_error_301(self, req, res, code, msg, headers)
def http_error_301(self, req, res, code, msg, headers): '''Update location and filter non-GET request before calling parent implementation. ''' method = req.get_method() resource = req.resource # Update resource location if 'location' in headers: resource.location = headers['location'] # Bail unless method is GET if method != 'GET': return res # Let parent handle the rest return HTTPRedirectHandler.http_error_301( self, req, res, code, msg, headers)
def http_error_301(self, req, fp, code, msg, headers): result = HTTPRedirectHandler.http_error_301(self, req, fp, code, msg, headers) result.status = code return result
def http_error_301(self, req, res, code, msg, hdrs): # Let parent handle the rest return HTTPRedirectHandler.http_error_301(self, req, res, code, msg, hdrs)