Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jersey-netty-connector – multipart payload can’t be sent when Expect100ContinueFeature is enabled #5833

Open
zhangzhengming opened this issue Jan 13, 2025 · 1 comment · May be fixed by #5847
Assignees

Comments

@zhangzhengming
Copy link

Using Jersey v2.46 with JDK 17

Use case 1 - uploading a file with Expect100ContinueFeature enabled.
Use case 2 - uploading a simple json payload with Expect100ContinueFeature enabled.

Steps of reproducing the issue(simple case with simple payload):
Download file JavaProject-100Continue.zip
Follow the steps in readme.txt file in the zip file:

  1. Running the test server(node js installation is required):
    cd [base_folder]/JavaProject-100Continue/src/main/resources
    node testserver.js

  2. Verify the test server
    Call the server with HTTP header expect:100-continue:
    curl -v --location 'http://127.0.0.1:3000' --header 'Content-Type: application/json' --header 'expect: 100-continue' --data '{"msg": "hello from curl"}'
    Expected response:
    {"message": "Request processed successfully after 100-continue."}

    Call the server without HTTP header:
    curl -v --location 'http://127.0.0.1:3000' --header 'Content-Type: application/json' --data '{"msg": "hello from curl"}'
    Expected response:
    {"message": "Request processed successfully."}

  3. Reproduce the issue(java/maven installation are required) with simple json payload:
    cd [base_folder]/JavaProject-100Continue
    mvn clean install && mvn exec:java
    No response returned from server.

  4. Just for comparing with the expected behavior, comment out below code to use the default connector provider.
    //defaultConfig.connectorProvider(new NettyConnectorProvider());
    Get response: { "message": "Request processed successfully after 100-continue." }

It seams Jersey can't handle HTTP code 100.

@sxsubram
Copy link

With config.register(Expect100ContinueFeature.basic()); feature enabled the payload is not being sent to the server after the server sends the 'Continue' response. Tried changing the size config.register(Expect100ContinueFeature.withCustomThreshold(4096)) but that did not help either.

@senivam senivam self-assigned this Jan 14, 2025
@senivam senivam linked a pull request Jan 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants