fix : 2.0 seems to have broken static file serving on azure. #21#30
Open
kfhak-zb wants to merge 2 commits intoyvele:masterfrom
Open
fix : 2.0 seems to have broken static file serving on azure. #21#30kfhak-zb wants to merge 2 commits intoyvele:masterfrom
kfhak-zb wants to merge 2 commits intoyvele:masterfrom
Conversation
for raw file data download and send
use like below
app.get("/api/getfile", function (req, res) {
const data = fs.readFileSync("sample.pdf");
res.writeHead(200, {
"Content-Type": "application/pdf",
"Content-Disposition": "attachment;filename=output.pdf"
});
res.end(data, "binary");
});
dcollien
suggested changes
Mar 7, 2019
src/OutgoingMessage.js
Outdated
| // https://github.com/Azure/azure-webjobs-sdk-script/issues/814 | ||
| // https://github.com/Azure/azure-webjobs-sdk-script/pull/781 | ||
| return Buffer.isBuffer(body) | ||
| return Buffer.isBuffer(body) && "binary" != encoding |
There was a problem hiding this comment.
change this to: encoding !== "binary" to pass eslint
"binary" != encoding to encoding !== "binary"
Codecov Report
@@ Coverage Diff @@
## master #30 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 4 4
Lines 67 67
Branches 18 18
=====================================
Hits 67 67
Continue to review full report at Codecov.
|
dcollien
approved these changes
Mar 18, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
for raw file data download and send
like below
if "encoding" value set to "binary"
then not doing body.toString() in convertToBody function
app.get("/api/getfile", function (req, res) {
});