[GH-ISSUE #9112] CORS error when requesting via Pyodide #15389

Closed
opened 2026-04-19 21:36:47 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @talpa-robin on GitHub (Jan 30, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/9112

Bug Report

Installation Method

Docker via Kubernetes

Environment

  • Open WebUI Version: v0.5.4

  • Ollama (if applicable): 0.5.6-0-g2539f2d-dirty

  • Operating System: macOS 15.2

  • Browser (if applicable): Chrome 131.0.6778.205

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

When getting Python code from the LLM that is supposed to do external calls, like to https://www.google.com, Pyodide should be able to resolve the external resource.

Actual Behavior:

I'm getting CORS errors like

pyodide.asm.js:10 Access to XMLHttpRequest at 'https://www.google.com/' from origin 'https://REDACTED' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The Python stacktrace says

File "/lib/python3.12/site-packages/requests/adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', HTTPException("Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://www.google.com/'."))

but I don't think that is important.

I guess the problem is, that the external requests doesn't include a "Origin" header and therefore doesn't get back CORS headers.

Description

Bug Summary:
Look at the actual behavior section

Reproduction Details

Steps to Reproduce:
Ask your LLM of choice to create Python script that calls https://www.google.com and prints the response. Then try to execute it within the conversion.

Originally created by @talpa-robin on GitHub (Jan 30, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/9112 # Bug Report ## Installation Method Docker via Kubernetes ## Environment - **Open WebUI Version:** v0.5.4 - **Ollama (if applicable):** 0.5.6-0-g2539f2d-dirty - **Operating System:** macOS 15.2 - **Browser (if applicable):** Chrome 131.0.6778.205 **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [ ] I am on the latest version of both Open WebUI and Ollama. - [x] I have included the browser console logs. - [ ] I have included the Docker container logs. - [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: When getting Python code from the LLM that is supposed to do external calls, like to https://www.google.com, Pyodide should be able to resolve the external resource. ## Actual Behavior: I'm getting CORS errors like ```` pyodide.asm.js:10 Access to XMLHttpRequest at 'https://www.google.com/' from origin 'https://REDACTED' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. ```` The Python stacktrace says ```` File "/lib/python3.12/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', HTTPException("Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://www.google.com/'.")) ```` but I don't think that is important. I guess the problem is, that the external requests doesn't include a "Origin" header and therefore doesn't get back CORS headers. ## Description **Bug Summary:** Look at the actual behavior section ## Reproduction Details **Steps to Reproduce:** Ask your LLM of choice to create Python script that calls https://www.google.com and prints the response. Then try to execute it within the conversion.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#15389