Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Premature dispatch creates null value body argument when incoming POST is dispatched before body arrives?

9.2.9 is rather old, even for the EOL 9.2.x series.
Consider using 9.2.28.v20190418.
Or if you want latest stable release, use 9.4.17.v20190418 

Joakim Erdfelt / joakim@xxxxxxxxxxx


On Sat, Apr 20, 2019 at 7:13 PM Patrick Dirks <pdirks@xxxxxxxxxx> wrote:
Hi,

I’m new to Jetty - I'm experimenting with an API on SwaggerHub and I've generated both client-side (cpprest) and server-side (JAX-RS) stubs from the API. My server side is running jetty-9.2.9.v20150224.

When I use a client like Postman, which sends the complete request (headers and body) in a single packet, the server responds as expected. When I use the generated (cpprest) client stubs the request headers come in a first packet and the body in a second packet. The strange part is that, although they re-assemble fine (I can see a valid-looking combined packet in Wireshark), it looks as if the server request is dispatched as soon as the headers arrive, without waiting for the body parameters to arrive (despite the "Content-length" header value)?

As a result the server sees a request that's got a "null" value for the body parameter (even though the parameter is marked as "required"), as if "delayDispatchUntilContent" is false? I've tried adding a "jetty.xml" file that explicitly defaults and sets "delayDispatchUntilContent" to "true" but that doesn't seem to make any difference.  Neither does Swagger 2.0 vs. OpenAPI 3.0 use make any difference.

Any idea what I'm missing here? Any suggestions for a workaround, or a fix?

Thanks in advance!
-Patrick.
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top