You've already forked snikket-web-portal
Force setting the SNIKKET_DOMAIN as HTTP Host when talking to prosody
This is required if the portal is talking to a Prosody with multiple HTTP domains and it doesn’t have http_default_host set... In a true snikket, this doesn’t happen, but we all know...
This commit is contained in:
@@ -144,6 +144,7 @@ class HTTPSessionManager:
|
|||||||
async def _create(self) -> aiohttp.ClientSession:
|
async def _create(self) -> aiohttp.ClientSession:
|
||||||
return aiohttp.ClientSession(headers={
|
return aiohttp.ClientSession(headers={
|
||||||
"Accept": "application/json",
|
"Accept": "application/json",
|
||||||
|
"Host": current_app.config["SNIKKET_DOMAIN"],
|
||||||
})
|
})
|
||||||
|
|
||||||
async def teardown(self, exc: typing.Optional[BaseException]) -> None:
|
async def teardown(self, exc: typing.Optional[BaseException]) -> None:
|
||||||
@@ -204,6 +205,7 @@ class HTTPAuthSessionManager(HTTPSessionManager):
|
|||||||
headers={
|
headers={
|
||||||
"Authorization": "Bearer {}".format(token),
|
"Authorization": "Bearer {}".format(token),
|
||||||
"Accept": "application/json",
|
"Accept": "application/json",
|
||||||
|
"Host": current_app.config["SNIKKET_DOMAIN"],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user