~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/service.py

  • Committer: Curtis Hovey
  • Date: 2012-03-17 21:41:08 UTC
  • Revision ID: curtis.hovey@canonical.com-20120317214108-wk8i7dyvve1std4u
Use propert reasons.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    def handle_request(self):
40
40
        """Select the method to handle the request and return a response."""
41
41
        if self.application != 'archive':
42
 
            return self.send_response(
43
 
                httplib.BAD_REQUEST, reason='Unsupported URL')
 
42
            return self.send_response(httplib.NOT_FOUND)
44
43
        if self.method == 'PUT':
45
44
            return self.do_PUT()
46
45
        elif self.method == 'POST':
47
46
            return self.do_POST()
48
47
        elif self.method == 'GET':
49
48
            return self.do_GET()
50
 
        return self.send_response(
51
 
            httplib.BAD_REQUEST, reason='Unsupported method')
 
49
        return self.send_response(httplib.METHOD_NOT_ALLOWED)
52
50
 
53
51
    def send_response(self, code, response='', reason=None, headers={}):
54
52
        """Set the status code and reason, then return the response."""