Comparing version 0.1.0 to 0.1.1-beta.1
@@ -108,15 +108,3 @@ import { randomUUID } from 'node:crypto'; | ||
} | ||
if (this.httpVersion == '1.1') { | ||
this.rawResponse.writeHead(this._status); | ||
} | ||
else { | ||
this.rawResponse.stream.respond({ | ||
...this.headers, | ||
[constants.HTTP2_HEADER_STATUS]: this._status, | ||
}); | ||
} | ||
if (data) { | ||
this.rawResponse.write(Buffer.from(data)); | ||
} | ||
this.rawResponse.end(); | ||
this._send(data); | ||
}, | ||
@@ -151,6 +139,7 @@ sendEvent(event) { | ||
} | ||
let stringifiedData; | ||
if (data) { | ||
data = Buffer.from(JSON.stringify(data)); | ||
stringifiedData = JSON.stringify(data); | ||
} | ||
this.send(data); | ||
this._send(stringifiedData); | ||
}, | ||
@@ -172,3 +161,18 @@ async stream(sourceStream) { | ||
}, | ||
_send(data) { | ||
if (this.httpVersion == '1.1') { | ||
this.rawResponse.writeHead(this._status); | ||
} | ||
else { | ||
this.rawResponse.stream.respond({ | ||
...this.headers, | ||
[constants.HTTP2_HEADER_STATUS]: this._status, | ||
}); | ||
} | ||
if (data) { | ||
this.rawResponse.write(Buffer.from(data)); | ||
} | ||
this.rawResponse.end(); | ||
}, | ||
}; | ||
//# sourceMappingURL=response.js.map |
{ | ||
"name": "fluvial", | ||
"version": "0.1.0", | ||
"version": "0.1.1-beta.1", | ||
"description": "Fluvial: A light http/2 server framework, similar to Express", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103699
1266