MCPcopy
hub / github.com/hugapi/hug / set_response_defaults

Method set_response_defaults

hug/interface.py:806–812  ·  view source on GitHub ↗

Sets up the response defaults that are defined in the URL route

(self, response, request=None)

Source from the content-addressed store, hash-verified

804 return empty.dict
805
806 def set_response_defaults(self, response, request=None):
807 """Sets up the response defaults that are defined in the URL route"""
808 for header_name, header_value in self.response_headers:
809 response.set_header(header_name, header_value)
810 if self.set_status:
811 response.status = self.set_status
812 response.content_type = self.content_type(request, response)
813
814 def render_errors(self, errors, request, response):
815 data = {"errors": errors}

Callers 2

__call__Method · 0.95
requestMethod · 0.80

Calls 1

content_typeMethod · 0.95

Tested by

no test coverage detected