(self, request, path)
return response
Handle HACS Web requests.
Handle HACS Web requests.
Handle HACS Web requests .
async def get(self, request, path):  # pylint: disable=unused-argument
        """Handle HACS Web requests."""
        if self.system.disabled:
            return web.Response(status=404)
        self.endpoint = path.split("/")[0]
        self.raw_headers = request.raw_headers
        self.request = request
        self.requested_file = path.replace(self.endpoint + "/", "")
        self.repository_id = path.replace(self.endpoint + "/", "")
        if self.endpoint != "static":
            self.logger.debug(f"Endpoint ({self.endpoint}) called")
        if self.configuration.dev:
            self.logger.debug(f"Raw headers ({self.raw_headers})")
            self.logger.debug(f"Postdata ({self.postdata})")
        if self.endpoint in WEBRESPONSE:
            try:
                response = WEBRESPONSE[self.endpoint]
                response = await response.response(self)
            except Exception as exception:
                render = self.render(f"error", message=exception)
                return web.Response(
                    body=render, content_type="text/html", charset="utf-8"
                )
        else:
            # Return default response.
            response = await WEBRESPONSE["generic"].response(self)

        # set headers
        response.headers["Cache-Control"] = "no-cache, must-revalidate, s-max_age=0"
        response.headers["Pragma"] = "no-cache"

        # serve the response
        return response
async def get ( self , request , path ) : # pylint: disable=unused-argument if self . system . disabled : return web . Response ( status = 404 ) self . endpoint = path . split ( "/" ) [ 0 ] self . raw_headers = request . raw_headers self . request = request self . requested_file = path . replace ( self . endpoint + "/" , "" ) self . repository_id = path . replace ( self . endpoint + "/" , "" ) if self . endpoint != "static" : self . logger . debug ( f"Endpoint ({self.endpoint}) called" ) if self . configuration . dev : self . logger . debug ( f"Raw headers ({self.raw_headers})" ) self . logger . debug ( f"Postdata ({self.postdata})" ) if self . endpoint in WEBRESPONSE : try : response = WEBRESPONSE [ self . endpoint ] response = await response . response ( self ) except Exception as exception : render = self . render ( f"error" , message = exception ) return web . Response ( body = render , content_type = "text/html" , charset = "utf-8" ) else : # Return default response. response = await WEBRESPONSE [ "generic" ] . response ( self ) # set headers response . headers [ "Cache-Control" ] = "no-cache, must-revalidate, s-max_age=0" response . headers [ "Pragma" ] = "no-cache" # serve the response return response