David Hamilton
03/22/2022, 6:38 PMAccept
header provided by client, providing json content only when specifically requested by the client.
However both my routes are now returning 405
whereas the fallback handler worked fine without the nested route:
"/mappings" bind routes(
Method.GET to routes(
header("Accept", "application/json") bind ingressTracingLoggingFilter.then(mappingsAdminJsonHandler),
Fallback bind ingressTracingLoggingFilter.then(mappingsAdminReportHandler)
),
<http://Method.POST|Method.POST> to someOtherHandler
),
What am I doing wrong?dave
03/22/2022, 6:54 PMDavid Hamilton
03/23/2022, 8:31 AMRequest(Method.GET, "<http://localhost>:$servicePort$path")
.header("Accept", "application/json")
.execute()
So surely that would match the filter? Also, why 405? Surely it should be handled by the Fallback
section? And why has the non-JSON test, which should be handled by the Fallback anyway suddenly started failing with 405 responses?
I'll investigate further this morningDavid Hamilton
03/23/2022, 8:33 AMDavid Hamilton
03/23/2022, 8:36 AM"/mappings" bind routes(
Method.GET to ingressTracingLoggingFilter.then(mappingsAdminReportHandler),
<http://Method.POST|Method.POST> to someOtherHandler
),
But now that non-JSON test also fails with 405 responseDavid Hamilton
03/23/2022, 5:38 PM"/mappings" bind routes(
Method.GET.and(header("Accept", "application/json")) bind ingressTracingLoggingFilter.then(mappingsAdminJsonHandler),
),
"/mappings" bind routes(
Method.GET to ingressTracingLoggingFilter.then(mappingsAdminReportHandler),
),
So why does that work, and not the nested header filter and fallback?dave
03/24/2022, 6:25 AMdave
03/24/2022, 6:27 AMDavid Hamilton
03/25/2022, 10:42 AM