Class QueryMethodOverrideFilter
- All Implemented Interfaces:
jakarta.ws.rs.container.ContainerRequestFilter
POST compatibility fallback for the
RFC 10008 QUERY HTTP method: network intermediaries (WAFs, proxies) or client
libraries that block non-standard HTTP methods can send a POST request carrying
the X-HTTP-Method-Override: QUERY header instead of a native QUERY request.
Runs PreMatching, i.e. before JAX-RS resource matching, so the rewritten request
is routed exactly as a native QUERY request would be, reaching the QUERY
-annotated controller method transparently.
The QUERY-annotated controller methods live directly on their collection's
canonical path (e.g. /contexts, same as GET /contexts) — no
/query path segment is part of the real contract. The POST fallback,
however, needs a distinct URL: a bare POST /contexts is conventionally a
"create" request, so a fallback landing there would collide with that meaning if such
an endpoint ever exists. Fallback callers therefore address the suffixed
.../query path instead, and this filter strips that suffix as part of the
rewrite, so both transports reach the exact same, suffix-free controller method.
- Author:
- Luca Frosini (ISTI - CNR)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfilter(jakarta.ws.rs.container.ContainerRequestContext requestContext)
-
Constructor Details
-
QueryMethodOverrideFilter
public QueryMethodOverrideFilter()
-
-
Method Details
-
filter
public void filter(jakarta.ws.rs.container.ContainerRequestContext requestContext) throws IOException - Specified by:
filterin interfacejakarta.ws.rs.container.ContainerRequestFilter- Throws:
IOException
-