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

fix: do not convert public file to strings #379

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const generatePublicDirectory = (app: TemplatedApp) => {
.writeStatus('200 OK')
.writeHeader('Access-Control-Allow-Origin', '*')
.writeHeader('Content-Type', contentType)
.end(fs.readFileSync(file).toString('utf-8'));
.end(fs.readFileSync(file));
});
} else {
notFound(res, new Error(`File not found: ${file}`));
Expand Down
16 changes: 15 additions & 1 deletion tests/workflow.stepci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -473,4 +473,18 @@ tests:
method: GET
check:
status: 200
body: This should be reachable!
body: This should be reachable!
- name: get images
http:
url: http://${{env.host}}/screenshot.png
method: GET
check:
status: 200
sha256: 87e26d176cea2f7465c52a4e7e186d6f7f15e61a8658e7b84420474883f073d3
- name: get audio
http:
url: http://${{env.host}}/file_example_MP3_700KB.mp3
method: GET
check:
status: 200
sha256: 9a2270d5964f64981fb1e91dd13e5941262817bdce873cf357c92adbef906b5d