-
Notifications
You must be signed in to change notification settings - Fork 222
Can not make response to Slack App if request body is already consumed #910
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
Comments
Hi @baseballyama, thanks for writing in! The reason why As you observed, if some component in your app consumes a request's body input stream plus doesn't provide a way to access the raw body, the app architecture is not suitable for running Slack app endpoints. In this case, our recommendation is to have a different app with less dependencies that is dedicated to handling incoming requests from Slack. I hope this answers your question! |
Thank you for the answer! So for instance, java-slack-sdk/slack-app-backend/src/main/java/com/slack/api/app_backend/SlackSignature.java Lines 164 to 165 in 8b1358a
Is this correct understanding? Thank you! |
Any data won't be dropped. However, the order of the parameters can be different if you generate a string request body data from a parsed Map object (as you know, the order of Map elements is not guaranteed in Java). To verify I hope this clarifies. Can we close this issue now? |
Yes. This is exactly the same as what I said. Now I got it well👍 |
Reproducible in:
The Slack SDK version
Java Runtime version
OS info
Steps to reproduce:
I will create a REPL if I need it.
But at first could you please read the below description?
If a maintainer gets the issue without REPL, I will create PR.
I'm using Spring Boot and Spring Security and JWT authentication methods.
Then Spring Security (before 5.6.0-RC1) consume request body at DefaultBearerTokenResolver.
Then ServletAdapterOps can not read a request body because it's already consumed.
Then following warning occurred.
Actually, this case is resolved at Spring Boot 5.6.0-RC1 by this PR.
But I think in other cases, possibly a request body is already consumed by something before run ServletAdapterOps
Therefore I think we should change logic like this.
Expected result:
Response something to Slack App.
Actual result:
Requirements
ServletAdapterOps should stop to read request body but should read from
getParameterMap()
.The text was updated successfully, but these errors were encountered: