Skip to content

Commit

Permalink
fix handling of binary data in FileSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed May 15, 2024
1 parent 1223f36 commit e0ca864
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.16.3
### Bug fix
* fix handling of binary data in FileSystem

## 0.16.2
### Bug fix
* fix for directories that don't end with trailing slash [#33](https://github.com/jcubic/wayne/issues/33)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=0.16.2
VERSION=0.16.3
DATE=`date -uR`
YEAR=`date +%Y`

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
alt="Logo of Wayne library - it represents construction worker helmet and text with the name of the library" />
</h1>

[![npm](https://img.shields.io/badge/npm-0.16.2-blue.svg)](https://www.npmjs.com/package/@jcubic/wayne)
[![npm](https://img.shields.io/badge/npm-0.16.3-blue.svg)](https://www.npmjs.com/package/@jcubic/wayne)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://makeapullrequest.com)

[Service Worker Routing library for in-browser HTTP requests](https://github.com/jcubic/wayne/)
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Wayne - Server Worker Routing library (v. 0.16.2)
* Wayne - Server Worker Routing library (v. 0.16.3)
*
* Copyright (c) 2022-2024 Jakub T. Jankiewicz <https://jcubic.pl/me>
* Released under MIT license
Expand Down Expand Up @@ -389,7 +389,7 @@ export function FileSystem(options) {
async function serve(res, path_name) {
const ext = path.extname(path_name);
const type = mime.getType(ext);
const data = await fs.readFile(path_name, 'utf8');
const data = await fs.readFile(path_name);
res.send(data, { type });
}
return async function(req, res, next) {
Expand Down
6 changes: 3 additions & 3 deletions index.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions index.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exports.Wayne = void 0;
exports.rpc = rpc;
exports.send = send;
/*
* Wayne - Server Worker Routing library (v. 0.16.2)
* Wayne - Server Worker Routing library (v. 0.16.3)
*
* Copyright (c) 2022-2024 Jakub T. Jankiewicz <https://jcubic.pl/me>
* Released under MIT license
Expand Down Expand Up @@ -393,7 +393,7 @@ function FileSystem(options) {
async function serve(res, path_name) {
const ext = path.extname(path_name);
const type = mime.getType(ext);
const data = await fs.readFile(path_name, 'utf8');
const data = await fs.readFile(path_name);
res.send(data, {
type
});
Expand Down
6 changes: 3 additions & 3 deletions index.umd.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jcubic/wayne",
"version": "0.16.2",
"version": "0.16.3",
"description": "Service Worker Routing for in browser HTTP requests",
"type": "module",
"main": "index.min.js",
Expand Down

0 comments on commit e0ca864

Please sign in to comment.