Skip to content

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

Description

@qingmuhy744

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions