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(frontend): do not use backend url in <img> #2424

Merged
merged 4 commits into from
Jul 2, 2024

Conversation

nicoloboschi
Copy link
Contributor

There's already a redirect in place for api calls.
This affect the user profile and the file react component in general

Fixes #2408

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. javascript Pull requests that update Javascript code labels Jun 28, 2024
BACKEND_URL.length - 1,
)}${BASE_URL_API}files/profile_pictures/${userData?.profile_image}` ??
profileCircle;
`${BASE_URL_API}files/profile_pictures/${
Copy link
Collaborator

@Cristhianzl Cristhianzl Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nicoloboschi,

I appreciate the refactor that removes the code from the src tag in the HTML.

I just wanted to provide some context and ask a question regarding the variable BACKEND_URL.
This variable was created because Langflow's frontend and backend do not always run on the same server URL. Hence, BACKEND_URL was introduced to handle this scenario.
If we revert to using BASE_URL_API, do you think it might break this setup? What are your thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Cristhianzl
the scenario is exactly that one, backend and frontend as separate service.
Removing the host will make the browser to reuse the same base host of the current webpage.

since this is an API call the correct flow is:

  • call <frontend_service>/api/....
  • The frontend redirects the call to the backend (as it does for other calls)

I've verified the fix with different ports/host for backend and frontend and it works well.

Copy link
Collaborator

@Cristhianzl Cristhianzl Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sence..
Awesome, I will trust in you in that case hahah
Thanks for your explanation and reply!

LGTM

@nicoloboschi nicoloboschi changed the title fronted: do not use backend url in <img> frontend: do not use backend url in <img> Jun 28, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 28, 2024
Copy link
Contributor

github-actions bot commented Jul 1, 2024

Cannot auto-update because of conflicts.

1 similar comment
Copy link
Contributor

github-actions bot commented Jul 1, 2024

Cannot auto-update because of conflicts.

@ogabrielluiz ogabrielluiz changed the title frontend: do not use backend url in <img> fix(frontend): do not use backend url in <img> Jul 1, 2024
Copy link
Contributor

github-actions bot commented Jul 1, 2024

Cannot auto-update because of conflicts.

auto-merge was automatically disabled July 2, 2024 13:11

Merge commits are not allowed on this repository

@nicoloboschi nicoloboschi merged commit b44e43a into langflow-ai:main Jul 2, 2024
1 check passed
nicoloboschi added a commit to datastax/ragstack-ai-langflow that referenced this pull request Jul 2, 2024
* fronted: do not use backend url in <img>

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit b44e43a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code 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.

Images Not Displaying Correctly in langflow (1.0.5) Docker Container Behind Traefik Proxy
2 participants