Integrated: 8272758: Improve HttpServer to avoid partial file name matches while mapping request path to context path

Volkan Yazici vyazici at openjdk.org
Thu Feb 19 09:46:56 UTC 2026


On Fri, 16 Jan 2026 08:07:48 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

> 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

This pull request has now been integrated.

Changeset: bea48b54
Author:    Volkan Yazici <vyazici at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/bea48b54e2f423693e1e472129a86b030baf9eee
Stats:     473 lines in 6 files changed: 447 ins; 2 del; 24 mod

8272758: Improve HttpServer to avoid partial file name matches while mapping request path to context path

Reviewed-by: dfuchs

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

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


More information about the net-dev mailing list