Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -379,26 +379,31 @@ async def play():
|
|
379 |
</script>
|
380 |
<script>
|
381 |
(function() {{
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
}}
|
392 |
-
|
393 |
-
|
394 |
-
if('Authorization' in init.headers) {{
|
395 |
-
init.headers['X-Authorization'] = init.headers['Authorization'];
|
396 |
-
delete init.headers['Authorization'];
|
397 |
-
}}
|
398 |
-
}}
|
399 |
-
}}
|
400 |
-
return originalFetch(input, init);
|
401 |
-
}};
|
402 |
}})();
|
403 |
</script>
|
404 |
</body>
|
|
|
379 |
</script>
|
380 |
<script>
|
381 |
(function() {{
|
382 |
+
const originalFetch = window.fetch;
|
383 |
+
window.fetch = function(input, init = {{}}) {{
|
384 |
+
if(init.headers) {{
|
385 |
+
if(init.headers instanceof Headers) {{
|
386 |
+
if(init.headers.has('Authorization')) {{
|
387 |
+
let authValue = init.headers.get('Authorization');
|
388 |
+
if (typeof authValue === 'string' && authValue.startsWith('Basic ')) {{
|
389 |
+
authValue = authValue.slice(6);
|
390 |
+
}}
|
391 |
+
init.headers.delete('Authorization');
|
392 |
+
init.headers.set('X-Authorization', authValue);
|
393 |
+
}}
|
394 |
+
}} else if (typeof init.headers === 'object') {{
|
395 |
+
if('Authorization' in init.headers) {{
|
396 |
+
let authValue = init.headers['Authorization'];
|
397 |
+
if (typeof authValue === 'string' && authValue.startsWith('Basic ')) {{
|
398 |
+
authValue = authValue.slice(6);
|
399 |
+
}}
|
400 |
+
init.headers['X-Authorization'] = authValue;
|
401 |
+
delete init.headers['Authorization'];
|
402 |
+
}}
|
403 |
+
}}
|
404 |
}}
|
405 |
+
return originalFetch(input, init);
|
406 |
+
}};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
407 |
}})();
|
408 |
</script>
|
409 |
</body>
|