Skip to content

RequestSupport#extractPathPrefix optimization - #915

Open
ok2c wants to merge 1 commit into
apache:masterfrom
ok2c:extract_path_prefix_optimization
Open

ok2c wants to merge 1 commit into
apache:masterfrom
ok2c:extract_path_prefix_optimization

Conversation

@ok2c

@ok2c ok2c commented Oct 31, 2026

Copy link
Copy Markdown
Member

No description provided.

@arturobernalg

Copy link
Copy Markdown
Member

@ok2c , I found a couple of regressions compared to master.

For /a/b/.., master returns /, whereas this change returns /a/b/. I reproduced this with HttpCore: a cached authentication entry for /a/b/ causes preemptive Authorization to be sent, while master waits for a challenge. The same issue occurs with encoded dot segments.

Also, foo returns fo, and since / is not in UNRESERVED, the fast path is never taken for normal absolute paths.

I think we should preserve the existing normalization semantics and add regression tests before merging.

@ok2c
ok2c force-pushed the extract_path_prefix_optimization branch 2 times, most recently from 96aff76 to 477b095 Compare October 31, 2026 11:01
@ok2c

ok2c commented Oct 31, 2026

Copy link
Copy Markdown
Member Author

@arturobernalg Excellent findings! Thank you so much!

For /a/b/.., master returns /, whereas this change returns /a/b/

But this is wrong, is it not? It should be /a/ should it not? I kept the existing behavior for now, but I think this has to be fixed

since / is not in UNRESERVED, the fast path is never taken for normal absolute paths.

Corrected. Please do another pass.

@arturobernalg

Copy link
Copy Markdown
Member

@arturobernalg Excellent findings! Thank you so much!

For /a/b/.., master returns /, whereas this change returns /a/b/

But this is wrong, is it not? It should be /a/ should it not? I kept the existing behavior for now, but I think this has to be fixed

since / is not in UNRESERVED, the fast path is never taken for normal absolute paths.

Corrected. Please do another pass.

But this is wrong, is it not? It should be /a/ should it not? I kept the existing behavior for now, but I think this has to be fixed

One remaining difference I noticed: consecutive slashes now bypass normalization. For /a//b, master returns /a/, while the new fast path returns /a//. this change intentional?

@ok2c

ok2c commented Oct 31, 2026

Copy link
Copy Markdown
Member Author

One remaining difference I noticed: consecutive slashes now bypass normalization. For /a//b, master returns /a/, while the new fast path returns /a//. this change intentional?

@arturobernalg No, it is not. I will look into it.

@ok2c
ok2c force-pushed the extract_path_prefix_optimization branch from 477b095 to fee2005 Compare October 31, 2026 13:18
@ok2c

ok2c commented Oct 31, 2026

Copy link
Copy Markdown
Member Author

@arturobernalg Please do another pass. Your feedback was super-valuable!

@arturobernalg arturobernalg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ok2c LGTM

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

Successfully merging this pull request may close these issues.

2 participants