owebjs 1.4.9-dev → 1.5.0-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/avatar.png CHANGED
Binary file
@@ -71,8 +71,10 @@ class HttpResponse extends Writable {
71
71
  //@ts-ignore
72
72
  write(data) {
73
73
  if (this.finished) return;
74
- this._flushHeaders();
75
- this.res.write(data);
74
+ this.res.cork(() => {
75
+ this._flushHeaders();
76
+ this.res.write(data);
77
+ });
76
78
  }
77
79
  writeHead(statusCode) {
78
80
  if (this.finished) return;
@@ -93,17 +95,15 @@ class HttpResponse extends Writable {
93
95
  //@ts-ignore
94
96
  end(data) {
95
97
  if (this.finished) return;
96
- const self = this;
97
- function doWrite() {
98
- self._flushHeaders();
99
- self.finished = true;
100
- self.res.end(data);
101
- }
102
- __name(doWrite, "doWrite");
103
- if (!data) {
104
- data = "";
105
- }
106
- return doWrite();
98
+ this.res.cork(() => {
99
+ this._flushHeaders();
100
+ this.finished = true;
101
+ if (!data) {
102
+ this.res.end();
103
+ } else {
104
+ this.res.end(data);
105
+ }
106
+ });
107
107
  }
108
108
  getRaw() {
109
109
  return this.res;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owebjs",
3
- "version": "1.4.9-dev",
3
+ "version": "1.5.0-dev",
4
4
  "description": "A flexible and modern web framework built on top of Fastify",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",