Allow CORS requests to token endpoint (#15519)

* Allow CORS requests to token endpoint

* Tests

* Fuck emulated hue

* Clean up

* Only cors existing methods
This commit is contained in:
Paulus Schoutsen authored and Paulus Schoutsen committed 2018-07-19 12:26:08 +02:00
1 parent ca0d4226aa
commit 2fc0d83085
9 files changed
+59 -23

No files matched your search

+2 -3
View File
@@ -187,8 +187,7 @@ class HomeAssistantHTTP(object):
support_legacy=hass.auth.support_legacy,
api_password=api_password)
if cors_origins:
setup_cors(app, cors_origins)
setup_cors(app, cors_origins)
app['hass'] = hass
@@ -226,7 +225,7 @@ class HomeAssistantHTTP(object):
'{0} missing required attribute "name"'.format(class_name)
)
view.register(self.app.router)
view.register(self.app, self.app.router)
def register_redirect(self, url, redirect_to):
"""Register a redirect with the server.