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

Please Add Support for application/x-www-form-urlencoded Media Type in request_body_var Plugin #24

Open
qingmuhy744 opened this issue Sep 18, 2024 · 1 comment

Comments

@qingmuhy744
Copy link

I am currently using the request_body_var plugin with Caddy to handle requests and extract variables from the request body. However, I've encountered an issue where the plugin does not support requests with the application/x-www-form-urlencoded content type. This is a common content type used in many web forms and handling this correctly is crucial for many server-side applications.

Error Details:
When attempting to retrieve a variable from a request body with the content type application/x-www-form-urlencoded, the plugin fails to initialize the querier and logs the following error:

{"level":"error","ts":1726639454.9856362,"logger":"http.handlers.request_body_var","msg":"failed to new querier","key":"Username","error":"unsupported Media Type: \"application/x-www-form-urlencoded\""}
This indicates that the current implementation does not support parsing application/x-www-form-urlencoded content types.

This indicates that the current implementation does not support parsing application/x-www-form-urlencoded content types.

Expected Behavior:
The plugin should be able to handle application/x-www-form-urlencoded content type by parsing the request body and allowing extraction of specified keys, similar to how it handles JSON and XML.

@RussellLuo
Copy link
Owner

@qingmuhy744 This should be relatively easy to implement, PRs are welcome :)

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

No branches or pull requests

2 participants