-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WebProfilerBundle] Fix AJAX panel with fetch requests #20724
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
Conversation
FIX: Bug trying to use a Request object as an string, because window.fetch implementation doesn't support Request as param, always is expecting url and params object.
@OnekO I rebased your branch to base it on 3.2 rather than master, as you started the edition in master rather than your target branch. |
@@ -243,6 +243,17 @@ | |||
var oldFetch = window.fetch; | |||
window.fetch = function () { | |||
var promise = oldFetch.apply(this, arguments); | |||
var paramType = Object.prototype.toString.call(arguments[0]); | |||
if (paramType === '[object Request]') { | |||
arguments[0] = arguments[0].url; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not mutate arguments
. It can cause issues. We should be using local variables instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I changed it again.
Thx :) |
Using local variables instead mutating arguments.
Thank you @OnekO. |
…ekO) This PR was squashed before being merged into the 3.2 branch (closes #20724). Discussion ---------- [WebProfilerBundle] Fix AJAX panel with fetch requests | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20723 | License | MIT | Doc PR | None Commits ------- 5527ee3 [WebProfilerBundle] Fix AJAX panel with fetch requests
…sts (OnekO) This PR was squashed before being merged into the 3.2 branch (closes symfony#20724). Discussion ---------- [WebProfilerBundle] Fix AJAX panel with fetch requests | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#20723 | License | MIT | Doc PR | None Commits ------- 5527ee3 [WebProfilerBundle] Fix AJAX panel with fetch requests
Uh oh!
There was an error while loading. Please reload this page.