Skip to content

Conversation

@nikitacano
Copy link
Contributor

Summary

This PR introduces a new Transform Rules template that allows customers to normalize encoded forward slashes (%2F) in the request path to standard slashes (/). This helps align Cloudflare’s request handling with origin server behavior, as many web servers automatically decode %2F into /.

The template uses the url_decode(http.request.uri.path) function to ensure consistency in URL-based rule evaluation, logging, and request processing. This change does not alter Cloudflare’s default behavior, which follows RFC 3986 by preserving encoded reserved characters. Instead, it provides an optional one-click solution for users who need it.

@nikitacano nikitacano requested review from a team and pedrosousa as code owners March 20, 2025 17:44
@hyperlint-ai
Copy link
Contributor

hyperlint-ai bot commented Mar 20, 2025

Howdy and thanks for contributing to our repo. The Cloudflare team reviews new, external PRs within two (2) weeks. If it's been two weeks or longer without any movement, please tag the PR Assignees in a comment.

We review internal PRs within 1 week. If it's something urgent or has been sitting without a comment, start a thread in the Developer Docs space internally.


PR Change Summary

Introduced a new Transform Rules template for normalizing encoded forward slashes in request paths.

  • Added a template to normalize encoded forward slashes (%2F) to standard slashes (/) in request paths.
  • Implemented the url_decode function for consistent URL handling.
  • Ensured the change does not alter Cloudflare's default behavior regarding encoded characters.

Added Files

  • src/content/docs/rules/transform/examples/normalize-encoded-slash.mdx

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

What is Hyperlint?

Hyperlint is an AI agent that helps you write, edit, and maintain your documentation.

Learn more about the Hyperlint AI reviewer and the checks that we can run on your documentation.

@github-actions github-actions bot added size/s product:rules Related to rules labels Mar 20, 2025
@nikitacano nikitacano enabled auto-merge (squash) March 21, 2025 10:22
@nikitacano nikitacano merged commit 16b1565 into production Mar 21, 2025
11 checks passed
@nikitacano nikitacano deleted the url-normalization-encoded-slash branch March 21, 2025 10:34
RebeccaTamachiro pushed a commit that referenced this pull request Apr 21, 2025
…es (%2F) (#20994)

* Rules: Add URL Rewrite Template for Normalizing Encoded Forward Slashes (%2F)

* PCX review

---------

Co-authored-by: Pedro Sousa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:rules Related to rules size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants