示例#1
0
 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)
示例#2
0
 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)
示例#3
0
    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)
示例#4
0
    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
示例#6
0
 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)
示例#7
0
文件: _base.py 项目: slibby/ArcREST
 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