Skip to content

feat: allow NGiNX to correctly process %2F special character in path parameters #103

@mikyll

Description

@mikyll

Referenced APISIX issue: apache/apisix#11810

Description

Currently, APISIX with radixtree_uri_with_parameter router doesn't support %2F in path parameters. That's due to how NGiNX processes the request URIs.

Feature Request

Add a NGiNX configuration directive to allow the correct processing of %2F character in URI. This directive, supposedly called decode_percent_characters would work like that:

  • by default is set to on, so that it doesn't change NGiNX default behaviour;
  • similarly to merge_slashes directive, it's passed to ngx_http_parse_complex_uri() from src/http/ngx_http_parse.c;
  • if set to off, NGiNX doesn't replace percent-encoded characters in request URIs, with their respective decoded values (i.e. %2f doesn't get decoded to / if we set decode_percent_characters off; in nginx.conf);

Additional Notes

I opened a issue some time ago on NGiNX, with the feature proposal and a possible implementation, but it didn't drag attention: nginx/nginx#501.

Questions

  • Do you think that this feature makes sense/could be useful?
  • Would it effectively solve the issue, or there's something I'm missing in the request processing and routing pipeline? Would that be the right component to introduce this feature?
  • How can I test a possible fix myself? Which file(s) do I have to edit and how can I compile?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions