Skip to content

Commit

Permalink
fix: fix issue in case the whole http header was not part of the firs…
Browse files Browse the repository at this point in the history
…t TCP packet..
  • Loading branch information
reey committed Jan 27, 2024
1 parent 1ed6542 commit 660fa70
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion backend/cumulocity.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"apiVersion": "2",
"name": "cloud-http-proxy",
"version": "1.0.2",
"version": "1.0.3",
"provider": {
"name": "Tristan Bastian",
"domain": "https://github.com/SoftwareAG/cumulocity-remote-access-cloud-http-proxy",
Expand Down
4 changes: 2 additions & 2 deletions backend/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 backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloud-http-proxy",
"version": "1.0.2",
"version": "1.0.3",
"description": "",
"main": "src/index.js",
"private": "true",
Expand Down
7 changes: 5 additions & 2 deletions backend/src/connection-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export class ConnectionHandler {
this.answerHealthRequest();
return;
} else {
this.logger.error(
"error 418, user did not provide configId or deviceId"
);
this.socket.write(
Buffer.from("HTTP/1.1 418\r\nContent-Length: 0\r\n\r\n")
);
Expand Down Expand Up @@ -329,10 +332,10 @@ export class ConnectionHandler {
}

private static getHeaderSection(partial: string): string | false {
const [headerSection] = partial.split(this.headerSeparator, 1);
if (headerSection === undefined) {
if (!this.headerSeparator.test(partial)) {
return false;
}
const [headerSection] = partial.split(this.headerSeparator, 1);
return headerSection;
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/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 frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remote-access-cloud-http-proxy-ui",
"version": "1.0.2",
"version": "1.0.3",
"author": "Tristan Bastian",
"description": "Allows to proxy HTTP requests through the cloud to an HTTP server running on a Cumulocity IoT connected device.",
"scripts": {
Expand Down

0 comments on commit 660fa70

Please sign in to comment.