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

Volkan Yazici vyazici at openjdk.org
Mon Feb 16 06:30:01 UTC 2026


> Currently `HttpServer` allows matching a request path `/foobar` to context path `/foo`. Replace this surprising behaviour with a safer approach by requiring exact *path prefix 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - Merge remote-tracking branch 'upstream/master' into srvCtxPath
 - Fix copyright year
 - Apply review feedback
 - Merge remote-tracking branch 'upstream/master' into srvCtxPath
 - Add property to switch between prefix matching schemes
 - Do exact path prefix matching in `HttpServer`

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/29264/files
  - new: https://git.openjdk.org/jdk/pull/29264/files/e55e6050..03cab635

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

  Stats: 55279 lines in 1102 files changed: 25032 ins; 9406 del; 20841 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