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

Explicitly set the content-type on HTTPReceiver responses to the /slack/install route #1280

Merged
merged 3 commits into from
Jan 21, 2022

Conversation

filmaj
Copy link
Contributor

@filmaj filmaj commented Jan 20, 2022

Summary

While most browsers will automatically infer the content-type header even if not set on HTTP responses, certain cloud hosting systems (e.g. AWS API Gateway) integrate with a variety of other services to provide content and have no means of inferring the content type. As a result, deploying bolt apps to AWS and integrating with API Gateway can be difficult.

This PR explicitly sets the Content-Type header to text/html for HTTPReceiver /slack/install route responses.

This PR fixes #1279.

@filmaj filmaj added the enhancement M-T: A feature request for new functionality label Jan 20, 2022
@filmaj filmaj added this to the 3.10.0 milestone Jan 20, 2022
@codecov
Copy link

codecov bot commented Jan 20, 2022

Codecov Report

Merging #1280 (bd95235) into main (ba64593) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head bd95235 differs from pull request most recent head f1bf78b. Consider uploading reports for the commit f1bf78b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1280      +/-   ##
==========================================
+ Coverage   73.22%   73.24%   +0.01%     
==========================================
  Files          17       17              
  Lines        1438     1439       +1     
  Branches      431      431              
==========================================
+ Hits         1053     1054       +1     
  Misses        300      300              
  Partials       85       85              
Impacted Files Coverage Δ
src/receivers/HTTPReceiver.ts 51.06% <100.00%> (+0.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba64593...f1bf78b. Read the comment docs.

src/receivers/HTTPReceiver.ts Outdated Show resolved Hide resolved
Co-authored-by: Kazuhiro Sera <ksera@slack-corp.com>
Co-authored-by: Kazuhiro Sera <ksera@slack-corp.com>
@filmaj filmaj merged commit 237a503 into main Jan 21, 2022
@filmaj filmaj deleted the content-type-on-install branch January 21, 2022 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure the /slack/install oauth installation handler sets the content-type in its HTTP response
2 participants