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

[WebProfilerBundle] modified url generation to use absolute urls #37576

Merged
merged 1 commit into from Jul 15, 2020

Conversation

smatyas
Copy link
Contributor

@smatyas smatyas commented Jul 14, 2020

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

TODO

  • gather feedback for my changes

Use case

The web debug toolbar ajax calls are broken in the case when you have to work with a page template that uses HTML <base> Tag for whatever reason.

In this case, the ajax calls of the debug toolbar will target that base url, as these urls are rendered as relative urls in the injected toolbar HTML content.

A simple solution for this issue is to generate absolute urls for these calls - this is my first approach in this PR.

A more complex solution would be a configurable behavior with the current method as the default.

I believe though that the simple solution is enough here, as it will result in the same requests for developers using templates without any <base> tag, and it will also make the dev toolbar usable for my case (using a <base> tag).

(Please let me know if I should make this PR against another branch.)

@fabpot
Copy link
Member

fabpot commented Jul 15, 2020

This approach works for me. You should target 4.4. Thank you.

@smatyas smatyas force-pushed the debug-toolbar-absolute-url-51 branch from 8b75dc2 to 3f3976b Compare July 15, 2020 12:35
@smatyas smatyas changed the base branch from 5.1 to 4.4 July 15, 2020 12:36
@smatyas
Copy link
Contributor Author

smatyas commented Jul 15, 2020

Thank you @fabpot I rebased my changes on top of 4.4 and changed the target branch of the PR.

@fabpot
Copy link
Member

fabpot commented Jul 15, 2020

Thank you @smatyas.

@adpeyre
Copy link
Contributor

adpeyre commented May 19, 2022

Good idea but absolute url can cause CORS problems in some situations. With a reverse proxy for example.

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

Successfully merging this pull request may close these issues.

None yet

4 participants