RFR: 8272758: Improve HttpServer to avoid partial file name matches while mapping request path to context path [v2]

Volkan Yazici vyazici at openjdk.org
Wed Jan 21 12:21:42 UTC 2026


> Currently `HttpServer` allows matching a request path `/foobar` to context path `/foo`. Replace this surprising behaviour with a safer approach by disallowing partial file name matches.
> 
> 
>          |           Request path
>  Context +------+-------+----------+---------
>   path   | /foo | /foo/ | /foo/bar | /foobar
> ---------+------+-------+----------+---------
>  /       |   Y  |   Y   |     Y    |    Y
>  /foo/   |   N  |   Y   |     Y    |    N

Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:

  Add property to switch between prefix matching schemes

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/29264/files
  - new: https://git.openjdk.org/jdk/pull/29264/files/f44d4b35..e80aabcb

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=29264&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=29264&range=00-01

  Stats: 543 lines in 6 files changed: 325 ins; 199 del; 19 mod
  Patch: https://git.openjdk.org/jdk/pull/29264.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29264/head:pull/29264

PR: https://git.openjdk.org/jdk/pull/29264


More information about the net-dev mailing list