BinaryONe
commited on
Commit
·
f0a84e7
1
Parent(s):
b938ac5
Cors Issue Test
Browse files
FileStream/server/routes_api.py
CHANGED
@@ -56,7 +56,7 @@ async def list_all_tmdb_movies_from_db(request):
|
|
56 |
#json_response = json.dumps(response).encode('utf-8')
|
57 |
# Return as aiohttp response using web.json_response
|
58 |
#return web.json_response(response)
|
59 |
-
return web.json_response(json.loads(dumps(response)))
|
60 |
|
61 |
async def list_all_tmdb_tv_from_db(request):
|
62 |
db = Database(Telegram.DATABASE_URL, Telegram.SESSION_NAME)
|
@@ -84,7 +84,7 @@ async def list_all_tmdb_tv_from_db(request):
|
|
84 |
#json_response = json.dumps(response).encode('utf-8')
|
85 |
# Return as aiohttp response using web.json_response
|
86 |
#return web.json_response(response)
|
87 |
-
return web.json_response(json.loads(dumps(response)))
|
88 |
|
89 |
#api.router.add_get('/tmdb/list', list_all_files_tmdb)
|
90 |
async def list_all_files_tmdb(request):
|
@@ -230,6 +230,7 @@ async def stream_handler(request: web.Request):
|
|
230 |
api = web.Application()
|
231 |
|
232 |
cors = aiohttp_cors.setup(api, defaults={
|
|
|
233 |
"*": aiohttp_cors.ResourceOptions(
|
234 |
allow_credentials=False,
|
235 |
expose_headers="*",
|
|
|
56 |
#json_response = json.dumps(response).encode('utf-8')
|
57 |
# Return as aiohttp response using web.json_response
|
58 |
#return web.json_response(response)
|
59 |
+
return web.json_response(json.loads(dumps(response)),{'Access-Control-Allow-Origin' :'*'})
|
60 |
|
61 |
async def list_all_tmdb_tv_from_db(request):
|
62 |
db = Database(Telegram.DATABASE_URL, Telegram.SESSION_NAME)
|
|
|
84 |
#json_response = json.dumps(response).encode('utf-8')
|
85 |
# Return as aiohttp response using web.json_response
|
86 |
#return web.json_response(response)
|
87 |
+
return web.json_response(json.loads(dumps(response)),,{'Access-Control-Allow-Origin' :'*'})
|
88 |
|
89 |
#api.router.add_get('/tmdb/list', list_all_files_tmdb)
|
90 |
async def list_all_files_tmdb(request):
|
|
|
230 |
api = web.Application()
|
231 |
|
232 |
cors = aiohttp_cors.setup(api, defaults={
|
233 |
+
{'Access-Control-Allow-Origin' :'*'},
|
234 |
"*": aiohttp_cors.ResourceOptions(
|
235 |
allow_credentials=False,
|
236 |
expose_headers="*",
|