inertia-sails 0.3.3 → 0.3.4
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.
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
const resolveValidationErrors = require('../helpers/resolve-validation-errors')
|
|
2
2
|
function inertia(hook) {
|
|
3
3
|
return function inertiaMiddleware(req, res, next) {
|
|
4
|
+
// Skip Inertia middleware for WebSocket requests
|
|
5
|
+
// WebSocket requests don't have req.flash() and don't need Inertia rendering
|
|
6
|
+
if (req.isSocket) {
|
|
7
|
+
return next()
|
|
8
|
+
}
|
|
9
|
+
|
|
4
10
|
const flash = {
|
|
5
11
|
message: req.flash('message'),
|
|
6
12
|
error: req.flash('error'),
|