javascript-solid-server 0.0.91 → 0.0.92

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/bin/jss.js CHANGED
@@ -188,6 +188,16 @@ program
188
188
  process.on('SIGINT', shutdown);
189
189
  process.on('SIGTERM', shutdown);
190
190
 
191
+ // Gracefully handle ECONNRESET — normal network noise from clients
192
+ // closing connections early (browser navigation, health checks, etc.)
193
+ process.on('uncaughtException', (err) => {
194
+ if (err.code === 'ECONNRESET' || err.code === 'EPIPE' || err.code === 'ECONNABORTED') {
195
+ return;
196
+ }
197
+ console.error('Uncaught exception:', err);
198
+ process.exit(1);
199
+ });
200
+
191
201
  } catch (err) {
192
202
  console.error(`Error: ${err.message}`);
193
203
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-solid-server",
3
- "version": "0.0.91",
3
+ "version": "0.0.92",
4
4
  "description": "A minimal, fast Solid server",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/server.js CHANGED
@@ -95,7 +95,16 @@ export function createServer(options = {}) {
95
95
  disableRequestLogging: true,
96
96
  trustProxy: true,
97
97
  // Handle raw body for non-JSON content
98
- bodyLimit: 10 * 1024 * 1024 // 10MB
98
+ bodyLimit: 10 * 1024 * 1024, // 10MB
99
+ // Gracefully handle client TCP errors (ECONNRESET, EPIPE, etc.)
100
+ clientErrorHandler: (err, socket) => {
101
+ if (err.code === 'ECONNRESET' || err.code === 'EPIPE' || err.code === 'ECONNABORTED') {
102
+ socket.destroy();
103
+ return;
104
+ }
105
+ // Default Fastify behavior for other client errors
106
+ socket.destroy(err);
107
+ }
99
108
  };
100
109
 
101
110
  // Add HTTPS support if SSL config provided