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

A request toward an invalid webhook URL get 200 OK response (expected: 302 redirection) #1122

Closed
tsasaki609 opened this issue Feb 26, 2023 · 3 comments · Fixed by #1123
Closed
Assignees
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented project:slack-api-client project:slack-api-client
Milestone

Comments

@tsasaki609
Copy link

Reproducible in:

mvn dependency:tree | grep com.slack.api
gradle dependencies | grep com.slack.api
java -version
sw_vers && uname -v # or `ver`

The Slack SDK version

com.slack.api:slack-api-client:1.27.3

Java Runtime version

openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment Homebrew (build 17.0.5+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.5+0, mixed mode, sharing)

OS info

ProductName: macOS
ProductVersion: 12.6
BuildVersion: 21G115
Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64

Steps to reproduce:

Submitting against a dummy webhook will result in a response with code 200 instead of an error code.

final var slack = Slack.getInstance();
final var response = slack.send("https://hooks.slack.com/services/dummy/dummy", Payload.builder().text(message.toString()).build());
if(response.getCode() != 200) {

Expected result:

Error codes should be returned.

Actual result:

Code 200 will be returned.

Requirements

Please make sure if this topic is specific to this SDK. For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.

@seratch seratch added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented project:slack-api-client project:slack-api-client and removed untriaged labels Feb 27, 2023
@seratch seratch self-assigned this Feb 27, 2023
@seratch seratch added this to the 1.28.0 milestone Feb 27, 2023
@seratch
Copy link
Member

seratch commented Feb 27, 2023

Hi @tsasaki609, thanks for reporting this issue! We will resolve the issue in the next release.

@seratch seratch changed the title sending against a dummy URL is successful A request toward an invalid webhook URL get 200 OK response (expected 302 redirection) Feb 27, 2023
@seratch
Copy link
Member

seratch commented Feb 27, 2023

Error codes should be returned.

I hear you that error code is easier to handle, but the server-side returns 302 status in this case. So, this SDK still does not return any error code even after the forthcoming fix on this issue.

@seratch seratch changed the title A request toward an invalid webhook URL get 200 OK response (expected 302 redirection) A request toward an invalid webhook URL get 200 OK response (expected: 302 redirection) Feb 27, 2023
seratch added a commit to seratch/java-slack-sdk that referenced this issue Feb 27, 2023
seratch added a commit that referenced this issue Feb 27, 2023
@tsasaki609
Copy link
Author

but the server-side returns 302 status in this case.

Thanks for the advice, I will handle it appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented project:slack-api-client project:slack-api-client
Projects
None yet
2 participants