Skip to content

fix(frontend): Fix the base URL supplied to the frontend#1706

Merged
phanan merged 2 commits intokoel:masterfrom
kondratovbr:master
Sep 22, 2023
Merged

fix(frontend): Fix the base URL supplied to the frontend#1706
phanan merged 2 commits intokoel:masterfrom
kondratovbr:master

Conversation

@kondratovbr
Copy link
Copy Markdown
Contributor

@kondratovbr kondratovbr commented Sep 22, 2023

I've encountered an issue when running behind a reverse proxy. Proxy terminates SSL correctly and provides correct X-Forwarded headers, but URLs generated for the frontend aren't https, so it tries to call the API via http which browsers explicitly forbid and throw an error along the lines of ...was not allowed to display insecure content from http://...

This PR fixes the BASE_URL explicitly used in Vue and the URL in <base> tag which may be used implicitly.

Now the "non-working" APP_URL ENV value actually does something.

@what-the-diff
Copy link
Copy Markdown

what-the-diff Bot commented Sep 22, 2023

PR Summary

  • Introduction of a New Function base_url()
    The team has added a new function named base_url() in the app/Helpers.php file. This function is designed to return the base URL of your application, which is essentially the root web address of your site. This could make it easier to manage and reference URLs across the application.

  • Modification in <base> Tag in base.blade.php
    The <base> HTML tag inside the resources/views/base.blade.php file has been updated to utilize the newly introduced base_url() function. This means that the base URL for all the relative URLs in the page will now be managed by this function, improving code consistency and maintainability.

@kondratovbr kondratovbr changed the title Fix the base URL supplied to the frontend fix(frontend): Fix the base URL supplied to the frontend Sep 22, 2023
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 22, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.05% ⚠️

Comparison is base (f2aff43) 83.99% compared to head (8bea390) 83.94%.
Report is 2 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1706      +/-   ##
============================================
- Coverage     83.99%   83.94%   -0.05%     
  Complexity      643      643              
============================================
  Files           143      143              
  Lines          1737     1738       +1     
============================================
  Hits           1459     1459              
- Misses          278      279       +1     
Files Changed Coverage Δ
app/Helpers.php 76.47% <0.00%> (-4.78%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@phanan phanan merged commit 05727fe into koel:master Sep 22, 2023
@phanan
Copy link
Copy Markdown
Member

phanan commented Sep 22, 2023

Thanks!

@phanan
Copy link
Copy Markdown
Member

phanan commented Jan 3, 2024

Reverted, as this caused #1732.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants