@hono/node-server 1.9.0 → 1.9.1

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/dist/index.js CHANGED
@@ -138,7 +138,7 @@ var newRequest = (incoming) => {
138
138
  const req = Object.create(requestPrototype);
139
139
  req[incomingKey] = incoming;
140
140
  req[urlKey] = new URL(
141
- `http://${incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
141
+ `${incoming instanceof import_node_http2.Http2ServerRequest || incoming.socket && incoming.socket.encrypted ? "https" : "http"}://${incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
142
142
  ).href;
143
143
  return req;
144
144
  };
package/dist/index.mjs CHANGED
@@ -100,7 +100,7 @@ var newRequest = (incoming) => {
100
100
  const req = Object.create(requestPrototype);
101
101
  req[incomingKey] = incoming;
102
102
  req[urlKey] = new URL(
103
- `http://${incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
103
+ `${incoming instanceof Http2ServerRequest || incoming.socket && incoming.socket.encrypted ? "https" : "http"}://${incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
104
104
  ).href;
105
105
  return req;
106
106
  };
package/dist/listener.js CHANGED
@@ -133,7 +133,7 @@ var newRequest = (incoming) => {
133
133
  const req = Object.create(requestPrototype);
134
134
  req[incomingKey] = incoming;
135
135
  req[urlKey] = new URL(
136
- `http://${incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
136
+ `${incoming instanceof import_node_http2.Http2ServerRequest || incoming.socket && incoming.socket.encrypted ? "https" : "http"}://${incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
137
137
  ).href;
138
138
  return req;
139
139
  };
package/dist/listener.mjs CHANGED
@@ -97,7 +97,7 @@ var newRequest = (incoming) => {
97
97
  const req = Object.create(requestPrototype);
98
98
  req[incomingKey] = incoming;
99
99
  req[urlKey] = new URL(
100
- `http://${incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
100
+ `${incoming instanceof Http2ServerRequest || incoming.socket && incoming.socket.encrypted ? "https" : "http"}://${incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
101
101
  ).href;
102
102
  return req;
103
103
  };
package/dist/request.js CHANGED
@@ -124,7 +124,7 @@ var newRequest = (incoming) => {
124
124
  const req = Object.create(requestPrototype);
125
125
  req[incomingKey] = incoming;
126
126
  req[urlKey] = new URL(
127
- `http://${incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
127
+ `${incoming instanceof import_node_http2.Http2ServerRequest || incoming.socket && incoming.socket.encrypted ? "https" : "http"}://${incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
128
128
  ).href;
129
129
  return req;
130
130
  };
package/dist/request.mjs CHANGED
@@ -97,7 +97,7 @@ var newRequest = (incoming) => {
97
97
  const req = Object.create(requestPrototype);
98
98
  req[incomingKey] = incoming;
99
99
  req[urlKey] = new URL(
100
- `http://${incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
100
+ `${incoming instanceof Http2ServerRequest || incoming.socket && incoming.socket.encrypted ? "https" : "http"}://${incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
101
101
  ).href;
102
102
  return req;
103
103
  };
package/dist/server.js CHANGED
@@ -135,7 +135,7 @@ var newRequest = (incoming) => {
135
135
  const req = Object.create(requestPrototype);
136
136
  req[incomingKey] = incoming;
137
137
  req[urlKey] = new URL(
138
- `http://${incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
138
+ `${incoming instanceof import_node_http2.Http2ServerRequest || incoming.socket && incoming.socket.encrypted ? "https" : "http"}://${incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
139
139
  ).href;
140
140
  return req;
141
141
  };
package/dist/server.mjs CHANGED
@@ -100,7 +100,7 @@ var newRequest = (incoming) => {
100
100
  const req = Object.create(requestPrototype);
101
101
  req[incomingKey] = incoming;
102
102
  req[urlKey] = new URL(
103
- `http://${incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
103
+ `${incoming instanceof Http2ServerRequest || incoming.socket && incoming.socket.encrypted ? "https" : "http"}://${incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
104
104
  ).href;
105
105
  return req;
106
106
  };
package/dist/vercel.js CHANGED
@@ -133,7 +133,7 @@ var newRequest = (incoming) => {
133
133
  const req = Object.create(requestPrototype);
134
134
  req[incomingKey] = incoming;
135
135
  req[urlKey] = new URL(
136
- `http://${incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
136
+ `${incoming instanceof import_node_http2.Http2ServerRequest || incoming.socket && incoming.socket.encrypted ? "https" : "http"}://${incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
137
137
  ).href;
138
138
  return req;
139
139
  };
package/dist/vercel.mjs CHANGED
@@ -97,7 +97,7 @@ var newRequest = (incoming) => {
97
97
  const req = Object.create(requestPrototype);
98
98
  req[incomingKey] = incoming;
99
99
  req[urlKey] = new URL(
100
- `http://${incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
100
+ `${incoming instanceof Http2ServerRequest || incoming.socket && incoming.socket.encrypted ? "https" : "http"}://${incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host}${incoming.url}`
101
101
  ).href;
102
102
  return req;
103
103
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/node-server",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Node.js Adapter for Hono",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",