Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return absolute path as the icon url if CONSOLE_API_URL is empty #15279

Merged
merged 2 commits into from
Mar 10, 2025

Conversation

kurokobo
Copy link
Contributor

@kurokobo kurokobo commented Mar 8, 2025

Summary

This is follow-up for #15241 by @crazywoola and @zhangxl01.

The PR #15241 solves the issue by Nginx, but I think the issue should be solved by the API side.

The issue is fundamentally caused by the API returning a relative path (without leading /) as the icon URL when the CONSOLE_API_URL is empty.

Image

If the specified URL does not start with /, the browser treats it as a relative path from the current URL. This causes 404 for all icons (See the screen shot below).

Simply ensuring that the API returns a path starting with / as the icon URL will resolve the issue, as the browser will interpret it as an absolute path from the root of the current domain.

Related #15189, #14668, #14835, #14570, #13982, #14835, #14578

Screenshots

Before After
Image Image

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 9, 2025
@crazywoola
Copy link
Member

crazywoola commented Mar 9, 2025

Cool, this seems much better to me. One thing should be addressed that #15241 this can fix the tools are missing temporary, because this can be done by restarting the container. This fix requires to rebuild the image which won't be available until next version. :)

I will merge this later. @kurokobo

@laipz8200 laipz8200 merged commit f2b7df9 into langgenius:main Mar 10, 2025
8 checks passed
@kurokobo kurokobo deleted the fix-icons branch March 10, 2025 05:48
@crazywoola crazywoola mentioned this pull request Mar 11, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants