Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 593800519
  • Loading branch information
colaboratory-team committed Dec 26, 2023
1 parent edee64a commit fc6e742
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions google/colab/_import_hooks/_generativeai.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ def fetch(request):
body = repr(request.body.decode('utf-8')) if request.body else 'null'
return output.eval_js("""
(async () => {{
// The User-Agent header causes CORS errors in Firefox.
const headers = {headers};
delete headers["User-Agent"];
const response = await fetch(new URL('{path}', 'https://generativelanguage.googleapis.com'), {{
method: '{method}',
headers: {headers},
body: {body}
body: {body},
headers,
}});
const json = await response.json();
return json;
Expand Down

0 comments on commit fc6e742

Please sign in to comment.