langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
50.37k stars 7.22k forks source link

File link input at start node is blocked by CORS #10136

Open fujita-h opened 1 day ago

fujita-h commented 1 day ago

Self Checks

Dify version

0.10.2

Cloud or Self Hosted

Cloud

Steps to reproduce

  1. Create simple chatflow app.
  2. Add a single image file input of type URL to the start node.
  3. Publish app.
  4. Start the published app (such as https://udify.app/chat/xxxxxxxxx) and enter the image URL https://cloud.dify.ai/logo/logo-site.png from the "Paste file link" button.

✔️ Expected Behavior

The file will be uploaded and a thumbnail image will be displayed.

❌ Actual Behavior

Display error message "Invalid file link".

There is a CORS issue because the app domain is udify.app, but the API domain is cloud.dify.ai.

{AA861DAF-5866-4FF9-B37A-D1EA08650F22}

dosubot[bot] commented 1 day ago

I found a similar discussion regarding CORS issues in the Dify repository. You might find it helpful to check out the following thread: Help: I'm encountering a CORS (Cross-Origin Resource Sharing) issue [1].

In Dify, CORS settings are configured using environment variables such as CONSOLE_CORS_ALLOW_ORIGINS and WEB_API_CORS_ALLOW_ORIGINS, both of which default to *, allowing access from all domains [2]. If you're encountering CORS issues, you might need to adjust these settings or update the domain configurations in your docker-compose.yml file if applicable [3].

For your specific issue with file link input being blocked by CORS, ensure that the domains used in your app and API are correctly configured to allow cross-origin requests. If the problem persists, you may need to look into server-side configurations or proxy settings to handle CORS more effectively.

To continue talking to Dosu, mention @dosu.