Skip to content

Conversation

@Qard
Copy link
Member

@Qard Qard commented Oct 22, 2025

This allows the http-rewriter to support both path-only rewriting and full URL rewriting, enabling backwards compatibility with how php-node presently works.

Depends on platformatic/http-handler#39

@Qard Qard self-assigned this Oct 22, 2025
@Qard Qard added the enhancement New feature or request label Oct 22, 2025
@Qard Qard force-pushed the more-flexible-url-path-rewriting branch from 66fa153 to ec5c1bb Compare October 22, 2025 01:01
ShogunPanda
ShogunPanda previously approved these changes Oct 22, 2025
@Qard Qard force-pushed the more-flexible-url-path-rewriting branch from ec5c1bb to d4911fb Compare October 22, 2025 05:34
@Qard Qard force-pushed the more-flexible-url-path-rewriting branch from d4911fb to 690d0d2 Compare October 22, 2025 05:50

// If the result doesn't have a scheme/authority but the original did,
// preserve the original scheme and authority
let final_uri = if new_uri.scheme().is_none() && parts.uri.scheme().is_some() {
Copy link

@simone-sanfratello simone-sanfratello Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd write it as follow to access parts.uri.scheme() once - but probably it's not relevant

let final_uri = if new_uri.scheme().is_none() {
    if let Some(scheme) = parts.uri.scheme() {

@Qard Qard merged commit 2c2319e into main Oct 22, 2025
9 checks passed
@Qard Qard deleted the more-flexible-url-path-rewriting branch October 22, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants