- Issue created by @ridefree
- 🇩🇪Germany jurgenhaas Gottmadingen
Hmm, never seen this before, but looking at the code, I wonder if
$response->getContent()
isn't returning any valid content which then leads to the JsonException. - Merge request !3Issue #3408255: Blocked rerouting of URL for jsonapi → (Merged) created by jurgenhaas
- Status changed to Needs review
12 months ago 7:39am 13 December 2023 - 🇩🇪Germany jurgenhaas Gottmadingen
Please give the MR/patch a try and let us know if that fixes your issue.
- 🇮🇳India saurabh-2k17
Hi @jurgenhaas, thanks for your response and MR. I updated the Drupal core to 10.1.7 and tried to visit https://sitenme.org/jsonapi/ and faced the similar issue. Later, I used your MR and patched the module but the same problem persists.
- 🇮🇳India saurabh-2k17
I found that the problem was not with the content, the content was already there, just that it was expecting it to be in a readable format. I made a slight change and it works now.
- 🇩🇪Germany jurgenhaas Gottmadingen
Would you mind collaborating in the MR instead of a new patch? The latter will not be supported for much longer.
WRT to your proposed change, I'm not sure that this is reasonable. The patch replaces the third argument
512
toJSON_UNESCAPED_SLASHES
which is about the depth of the JSON decoding, where the new argument is a constant which should be used as a constant for the fourth argument.Looking at my proposed change in the MR, I just realized that we're currently using the option
JSON_THROW_ON_ERROR
. That might be the issue, as this will throw the exception and prevent any further handling of other middlewares being in place.I've updated the MR to catch exceptions from JSON decoding and encoding to make sure, that this subscriber will not do anything if the JSON caused any issues.
Please give that another try and if you need to propose further changes, please do that in the issue fork.
- Status changed to RTBC
11 months ago 8:05pm 28 December 2023 - 🇮🇳India saurabh-2k17
Apologies @jurgenhaas, I will keep MR thing in mind. I see what you did and tested it too, it works! I am changing the state to RTBC.
-
jurgenhaas →
committed d3d996e7 on 1.1.x
Issue #3408255 by jurgenhaas, saurabh-2k17: Blocked rerouting of URL for...
-
jurgenhaas →
committed d3d996e7 on 1.1.x
- Status changed to Fixed
11 months ago 8:09am 29 December 2023 Automatically closed - issue fixed for 2 weeks with no activity.