Skip to content

Commit

Permalink
Merge branch 'release/0.9.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Apr 5, 2019
2 parents 45010a5 + eae154d commit 1fd5889
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 44 deletions.
67 changes: 36 additions & 31 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [0.9.4] - 2019-04-05
### Changed
* Support Preflight request

## [0.9.3] - 2019-03-31
### Fixed
* Fix sender's header to have "Access-Control-Allow-Origin: *" when an access order is "sender => receiver"
Expand Down Expand Up @@ -157,35 +161,36 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
* Docker automated build on Docker Hub
* Support HTTPS

[Unreleased]: https://github.com/nwtgck/piping-server/compare/v0.9.3...HEAD
[0.9.3]: https://github.com/nwtgck/piping-seraver/compare/v0.9.2...v0.9.3
[0.9.2]: https://github.com/nwtgck/piping-seraver/compare/v0.9.1...v0.9.2
[0.9.1]: https://github.com/nwtgck/piping-seraver/compare/v0.9.0...v0.9.1
[0.9.0]: https://github.com/nwtgck/piping-seraver/compare/v0.8.10...v0.9.0
[0.8.10]: https://github.com/nwtgck/piping-seraver/compare/v0.8.9...v0.8.10
[0.8.9]: https://github.com/nwtgck/piping-seraver/compare/v0.8.8...v0.8.9
[0.8.8]: https://github.com/nwtgck/piping-seraver/compare/v0.8.7...v0.8.8
[0.8.7]: https://github.com/nwtgck/piping-seraver/compare/v0.8.6...v0.8.7
[0.8.6]: https://github.com/nwtgck/piping-seraver/compare/v0.8.5...v0.8.6
[0.8.5]: https://github.com/nwtgck/piping-seraver/compare/v0.8.4...v0.8.5
[0.8.4]: https://github.com/nwtgck/piping-seraver/compare/v0.8.3...v0.8.4
[0.8.3]: https://github.com/nwtgck/piping-seraver/compare/v0.8.2...v0.8.3
[0.8.2]: https://github.com/nwtgck/piping-seraver/compare/v0.8.1...v0.8.2
[0.8.1]: https://github.com/nwtgck/piping-seraver/compare/v0.8.0...v0.8.1
[0.8.0]: https://github.com/nwtgck/piping-seraver/compare/v0.7.1...v0.8.0
[0.7.1]: https://github.com/nwtgck/piping-seraver/compare/v0.7.0...v0.7.1
[0.7.0]: https://github.com/nwtgck/piping-seraver/compare/v0.6.1...v0.7.0
[0.6.1]: https://github.com/nwtgck/piping-seraver/compare/v0.6.0...v0.6.1
[0.6.0]: https://github.com/nwtgck/piping-seraver/compare/v0.5.1...v0.6.0
[0.5.1]: https://github.com/nwtgck/piping-seraver/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/nwtgck/piping-seraver/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/nwtgck/piping-seraver/compare/v0.3.6...v0.4.0
[0.3.6]: https://github.com/nwtgck/piping-seraver/compare/v0.3.5...v0.3.6
[0.3.5]: https://github.com/nwtgck/piping-seraver/compare/v0.3.4...v0.3.5
[0.3.4]: https://github.com/nwtgck/piping-seraver/compare/v0.3.3...v0.3.4
[0.3.3]: https://github.com/nwtgck/piping-seraver/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/nwtgck/piping-seraver/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/nwtgck/piping-seraver/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/nwtgck/piping-seraver/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/nwtgck/piping-seraver/compare/v0.2.0...v0.2.1
[Unreleased]: https://github.com/nwtgck/piping-server/compare/v0.9.4...HEAD
[0.9.4]: https://github.com/nwtgck/piping-server/compare/v0.9.3...v0.9.4
[0.9.3]: https://github.com/nwtgck/piping-server/compare/v0.9.2...v0.9.3
[0.9.2]: https://github.com/nwtgck/piping-server/compare/v0.9.1...v0.9.2
[0.9.1]: https://github.com/nwtgck/piping-server/compare/v0.9.0...v0.9.1
[0.9.0]: https://github.com/nwtgck/piping-server/compare/v0.8.10...v0.9.0
[0.8.10]: https://github.com/nwtgck/piping-server/compare/v0.8.9...v0.8.10
[0.8.9]: https://github.com/nwtgck/piping-server/compare/v0.8.8...v0.8.9
[0.8.8]: https://github.com/nwtgck/piping-server/compare/v0.8.7...v0.8.8
[0.8.7]: https://github.com/nwtgck/piping-server/compare/v0.8.6...v0.8.7
[0.8.6]: https://github.com/nwtgck/piping-server/compare/v0.8.5...v0.8.6
[0.8.5]: https://github.com/nwtgck/piping-server/compare/v0.8.4...v0.8.5
[0.8.4]: https://github.com/nwtgck/piping-server/compare/v0.8.3...v0.8.4
[0.8.3]: https://github.com/nwtgck/piping-server/compare/v0.8.2...v0.8.3
[0.8.2]: https://github.com/nwtgck/piping-server/compare/v0.8.1...v0.8.2
[0.8.1]: https://github.com/nwtgck/piping-server/compare/v0.8.0...v0.8.1
[0.8.0]: https://github.com/nwtgck/piping-server/compare/v0.7.1...v0.8.0
[0.7.1]: https://github.com/nwtgck/piping-server/compare/v0.7.0...v0.7.1
[0.7.0]: https://github.com/nwtgck/piping-server/compare/v0.6.1...v0.7.0
[0.6.1]: https://github.com/nwtgck/piping-server/compare/v0.6.0...v0.6.1
[0.6.0]: https://github.com/nwtgck/piping-server/compare/v0.5.1...v0.6.0
[0.5.1]: https://github.com/nwtgck/piping-server/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/nwtgck/piping-server/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/nwtgck/piping-server/compare/v0.3.6...v0.4.0
[0.3.6]: https://github.com/nwtgck/piping-server/compare/v0.3.5...v0.3.6
[0.3.5]: https://github.com/nwtgck/piping-server/compare/v0.3.4...v0.3.5
[0.3.4]: https://github.com/nwtgck/piping-server/compare/v0.3.3...v0.3.4
[0.3.3]: https://github.com/nwtgck/piping-server/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/nwtgck/piping-server/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/nwtgck/piping-server/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/nwtgck/piping-server/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/nwtgck/piping-server/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/nwtgck/piping-server/compare/v0.1.0...v0.2.0
22 changes: 11 additions & 11 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "piping-server",
"version": "0.9.3",
"version": "0.9.4",
"description": "Streaming Data Transfer Server over HTTP/HTTPS",
"bin": {
"piping-server": "dist/src/index.js"
Expand All @@ -26,7 +26,7 @@
"type": "git",
"url": "https://github.com/nwtgck/piping-server"
},
"author": "Ryo Ota",
"author": "Ryo Ota <[email protected]> (https://github.com/nwtgck)",
"license": "MIT",
"devDependencies": {
"@types/mocha": "^5.0.0",
Expand Down
9 changes: 9 additions & 0 deletions src/piping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,15 @@ export class Server {
break;
}
break;
case "OPTIONS":
res.writeHead(200, {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, HEAD, POST, PUT, OPTIONS",
"Access-Control-Allow-Headers": "Content-Type, Content-Disposition",
"Access-Control-Max-Age": 86400,
"Content-Length": 0
});
res.end();
default:
res.end(`[ERROR] Unsupported method: ${req.method}.\n`);
break;
Expand Down
13 changes: 13 additions & 0 deletions test/piping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ describe("piping.Server", () => {
});
});

it("should support Preflight request", async () => {
const res = await thenRequest("OPTIONS", `${pipingUrl}/mydataid`);

assert.strictEqual(res.statusCode, 200);

const headers = res.headers;
assert.strictEqual(headers["access-control-allow-origin"], "*");
assert.strictEqual(headers["access-control-allow-methods"], "GET, HEAD, POST, PUT, OPTIONS");
assert.strictEqual(headers["access-control-allow-headers"], "Content-Type, Content-Disposition");
assert.strictEqual(headers["access-control-max-age"], "86400");
assert.strictEqual(headers["content-length"], "0");
});

it("should handle connection (receiver O, sender: O)", async () => {
// Get request promise
const reqPromise = thenRequest("GET", `${pipingUrl}/mydataid`);
Expand Down

0 comments on commit 1fd5889

Please sign in to comment.