ultimate-express 1.2.25 → 1.2.27
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/README.md +1 -1
- package/package.json +1 -1
- package/src/response.js +1 -0
package/README.md
CHANGED
|
@@ -119,7 +119,7 @@ Optimized routes can be up to 10 times faster than normal routes, as they're usi
|
|
|
119
119
|
|
|
120
120
|
Since you don't create http server manually, you can't properly use http.on("upgrade") to handle WebSockets. To solve this, there's currently 2 options:
|
|
121
121
|
|
|
122
|
-
- There's
|
|
122
|
+
- There's a sister library that implements `ws` compatible API: [Ultimate WS](https://github.com/dimdenGD/ultimate-ws). It's same concept as this library, but for WebSockets: fast drop-in replacement for `ws` module with support for Ultimate Express upgrades. There's a guide for how to upgrade http requests in the documentation.
|
|
123
123
|
- You can simply use `app.uwsApp` to access uWebSockets.js `App` instance and call its `ws()` method directly.
|
|
124
124
|
|
|
125
125
|
## Compatibility
|
package/package.json
CHANGED
package/src/response.js
CHANGED
|
@@ -389,6 +389,7 @@ module.exports = class Response extends Writable {
|
|
|
389
389
|
if(!this.headers['content-type']) {
|
|
390
390
|
const m = mime.lookup(fullpath);
|
|
391
391
|
if(m) this.type(m);
|
|
392
|
+
else this.type('application/octet-stream');
|
|
392
393
|
}
|
|
393
394
|
if(options.cacheControl) {
|
|
394
395
|
this.headers['cache-control'] = `public, max-age=${options.maxAge / 1000}` + (options.immutable ? ', immutable' : '');
|