This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+13 -13
View File
@@ -1,32 +1,32 @@
{
"_args": [
[
"serve-placeholder@1.2.2",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"serve-placeholder@1.2.4",
"/home/node/nuxt"
]
],
"_from": "serve-placeholder@1.2.2",
"_id": "serve-placeholder@1.2.2",
"_from": "serve-placeholder@1.2.4",
"_id": "serve-placeholder@1.2.4",
"_inBundle": false,
"_integrity": "sha512-4zczakjRPVbX5XBcJqUoyiwiMEXWPBj0rEexQkiQitKEkj36szAmw5DgcgOpWiXtRTU7aqJ47hjnYJg+2FSj5g==",
"_integrity": "sha512-jWD9cZXLcr4vHTTL5KEPIUBUYyOWN/z6v/tn0l6XxFhi9iqV3Fc5Y1aFeduUyz+cx8sALzGCUczkPfeOlrq9jg==",
"_location": "/serve-placeholder",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "serve-placeholder@1.2.2",
"raw": "serve-placeholder@1.2.4",
"name": "serve-placeholder",
"escapedName": "serve-placeholder",
"rawSpec": "1.2.2",
"rawSpec": "1.2.4",
"saveSpec": null,
"fetchSpec": "1.2.2"
"fetchSpec": "1.2.4"
},
"_requiredBy": [
"/@nuxt/server"
],
"_resolved": "https://registry.npmjs.org/serve-placeholder/-/serve-placeholder-1.2.2.tgz",
"_spec": "1.2.2",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/serve-placeholder/-/serve-placeholder-1.2.4.tgz",
"_spec": "1.2.4",
"_where": "/home/node/nuxt",
"bugs": {
"url": "https://github.com/nuxt/serve-placeholder/issues"
},
@@ -34,7 +34,7 @@
"Pooya Parsa <pooya@pi0.ir>"
],
"dependencies": {
"defu": "^1.0.0"
"defu": "^5.0.0"
},
"description": "Connect/Express middleware to respond with better placeholders based on request instead of 404 page",
"devDependencies": {
@@ -69,5 +69,5 @@
"release": "standard-version && git push --follow-tags && npm publish",
"test": "npm run lint && npm run jest"
},
"version": "1.2.2"
"version": "1.2.4"
}
+4
View File
@@ -8,6 +8,10 @@ module.exports = function createServePlaceholder (_options) {
const options = defu(_options, defaults)
return function servePlaceholderMiddleware (req, res, next) {
// If response already sent, skip
if (res.writableEnded) {
return
}
// Get url from req object
const url = req.url.split('?')[0]