HttpRouter: Decode path parts before matching. #19

Merged
jordan merged 2 commits from lda/Cytoplasm:encode-http into master 2023-12-02 15:25:29 +00:00
Contributor
Required by Telodendria/Telodendria#44.
lda added 1 commit 2023-11-30 17:45:23 +00:00
jordan reviewed 2023-11-30 18:12:52 +00:00
src/HttpRouter.c Outdated
@ -267,3 +268,3 @@
}
ArrayAdd(matches, substr);
ArrayAdd(matches, HttpUrlDecode(substr));
Owner

I think the decoding should happen before the matching. It would be confusing to match on an encoded path part but then have the decoded part be something totally different. So, we should decode the pathPart before feeding it into regexec(), match on that, and then take the appropriate substring from the decoded path part.

I think the decoding should happen *before* the matching. It would be confusing to match on an encoded path part but then have the decoded part be something totally different. So, we should decode the `pathPart` before feeding it into `regexec()`, match on that, and then take the appropriate substring from the decoded path part.
Author
Contributor

Fixed!

Fixed!
lda marked this conversation as resolved
lda added 1 commit 2023-11-30 18:19:43 +00:00
jordan changed title from Decode matches in HTTP router. to HttpRouter: Decode path parts before matching. 2023-11-30 18:53:44 +00:00
jordan merged commit 17f1a41519 into master 2023-12-02 15:25:28 +00:00
jordan added this to the Cytoplasm v0.4.1 milestone 2023-12-02 15:27:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Telodendria/Cytoplasm#19
No description provided.