Skip to content

Commit

Permalink
Add the version protocol header
Browse files Browse the repository at this point in the history
  • Loading branch information
flowersinthesand committed May 4, 2017
1 parent 5838280 commit 25e64c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/src/main/java/io/cettia/DefaultServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ public void on() {
});

Map<String, String> headers = new LinkedHashMap<>();
headers.put("cettia-version", "1.0");
headers.put("cettia-id", id);
headers.put("cettia-heartbeat", options.get("heartbeat"));
headers.put("cettia-_heartbeat", options.get("_heartbeat"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ private static class StreamTransport extends BaseTransport {
public StreamTransport(ServerHttpExchange http) {
super(http);
Map<String, String> query = new LinkedHashMap<>();
query.put("cettia-transport-version", "1.0");
query.put("cettia-transport-id", id);
http.onfinish(new VoidAction() {
@Override
Expand Down Expand Up @@ -415,6 +416,7 @@ public void on() {
switch (when) {
case "open":
Map<String, String> query = new LinkedHashMap<>();
query.put("cettia-transport-version", "1.0");
query.put("cettia-transport-id", id);
endWithMessage(http, "?" + formatQuery(query));
break;
Expand Down
2 changes: 1 addition & 1 deletion server/src/test/resources/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": "true",
"devDependencies": {
"cettia-protocol": "cettia/cettia-protocol#f2a9df19c92541215c8ee7f19d2939181ba99b22",
"cettia-protocol": "cettia/cettia-protocol#f83e99cdc202b4818c2041b1563ee8a6ac8c8f00",
"mocha": "^3.2.0",
"chai": "^3.5.0",
"minimist": "^1.2.0"
Expand Down

0 comments on commit 25e64c6

Please sign in to comment.