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

Escape all string values in broken json from php-fpm status #292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jvrsantacruz
Copy link

@jvrsantacruz jvrsantacruz commented Mar 24, 2023

php-fpm status page sends a broken json where string values are not escaped.
eg: "user":"myval\srv_monitor"

There is a current fix in place specifically for the request uri field.
This pull request extends this fix to all string fields in the JSON response.

The problem with broken JSON is that only with regexes we cannot reliably split the JSON and extract the strings.
The strategy is to break down the string to get the values between field names in the form "user":, detect the values that are of type string and apply the same json.Marshall escaping.

Should fix #258 and #291

@jvrsantacruz
Copy link
Author

Hi there! :-)

Is there anything else missing in the PR? I'd be more than happy to fix whatever is needed.
We're currently using a fork in our production environments and it's not ideal.

Thank you!

@jvrsantacruz
Copy link
Author

Hi! :-)

Is there something that I can/need to add to the branch so it can be released?

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.

New line in request uri causes error
1 participant