mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
c2191e3ce2
When parsing a relative URI such as `path2#foo`, RfcUriParser's SCHEME_OR_PATH state advanced to FRAGMENT without moving the component index past the `#` character, so the captured fragment included the entire input (`path2#foo`) instead of just `foo`. As a result, `toUriString()` produced `path2#path2#foo`. Update the SCHEME_OR_PATH `#` transition to advance the component index to `i + 1`, matching the sibling `?` -> QUERY transition in the same state and every other `-> FRAGMENT` transition in the parser. URIs with a `/` in the path are unaffected because they leave SCHEME_OR_PATH for PATH on the first slash; the WhatWG parser already handled this case correctly. Closes gh-36762 Signed-off-by: daguimu <daguimu.geek@gmail.com>