Fix UTF-8 routing with wide Char and FPC Radix callbacks - #556
Open
Moonbot-Tech wants to merge 5 commits into
Open
Fix UTF-8 routing with wide Char and FPC Radix callbacks#556Moonbot-Tech wants to merge 5 commits into
Moonbot-Tech wants to merge 5 commits into
Conversation
Contributor
|
Obrigado pela correção e pela matriz de validação. A direção de trabalhar com bytes UTF-8 nos dois roteadores é coerente, e o bridge FPC elimina o cast de método incompatível. Antes da aprovação, porém, precisamos cobrir alguns pontos que os testes atuais — baseados principalmente em
Depois desses ajustes, poderemos validar novamente a compatibilidade Delphi/FPC e os dois roteadores para aprovação. |
Author
|
Obrigado pela revisão detalhada. Apliquei todos os pontos:
Validei os dois roteadores com chamadas HTTP reais no Delphi 12.2 e os caminhos Tree, Radix e nested routing no MoonCompiler/FPC. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Horse parses request paths into UTF-8 byte slices, but its registered literal routes were still compared as character strings. With a wide
Char(SizeOf(Char) > 1), byte length and character length diverged and non-ASCII routes such as/ação/:idcould not match/ação/42.The optional Radix router had the same byte/character mismatch. Its FPC executor also stored the object method
DoPreValidationas a plain procedure callback, which violates the callback ABI: the route could match, but invoking the callback corrupted execution.Fix
Charis wide;TEncoding.UTF8;ASCII and single-byte
Charpaths keep their existing fast path.Validation
The focused runtime matrix passes with:
The matrix covers ASCII routes, UTF-8 literal and parameter routes, Radix static-route byte storage, byte-span decoding, and callback execution.