psf-bch-api 7.3.0 → 7.3.2
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/server.js +13 -0
- package/package.json +3 -3
package/bin/server.js
CHANGED
|
@@ -74,6 +74,19 @@ class Server {
|
|
|
74
74
|
allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With']
|
|
75
75
|
}))
|
|
76
76
|
|
|
77
|
+
// URL normalization middleware - collapse multiple slashes
|
|
78
|
+
app.use((req, res, next) => {
|
|
79
|
+
if (req.url && req.url.includes('//')) {
|
|
80
|
+
// Split URL into path and query string
|
|
81
|
+
const [path, queryString] = req.url.split('?')
|
|
82
|
+
// Collapse multiple consecutive slashes into a single slash
|
|
83
|
+
const normalizedPath = path.replace(/\/+/g, '/')
|
|
84
|
+
// Reconstruct req.url with normalized path (req.path is read-only and will auto-update)
|
|
85
|
+
req.url = queryString ? `${normalizedPath}?${queryString}` : normalizedPath
|
|
86
|
+
}
|
|
87
|
+
next()
|
|
88
|
+
})
|
|
89
|
+
|
|
77
90
|
// Apply basic auth middleware if enabled
|
|
78
91
|
// This must run before x402 middleware to set req.locals.basicAuthValid
|
|
79
92
|
if (basicAuthSettings.enabled) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "psf-bch-api",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.2",
|
|
4
4
|
"main": "psf-bch-api.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"description": "REST API proxy to Bitcoin Cash infrastructure",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@psf/bch-js": "7.1.
|
|
18
|
+
"@psf/bch-js": "7.1.7",
|
|
19
19
|
"axios": "1.7.7",
|
|
20
20
|
"cors": "2.8.5",
|
|
21
21
|
"dotenv": "16.3.1",
|
|
22
22
|
"express": "5.1.0",
|
|
23
|
-
"minimal-slp-wallet": "7.
|
|
23
|
+
"minimal-slp-wallet": "7.1.2",
|
|
24
24
|
"psffpp": "1.2.1",
|
|
25
25
|
"slp-token-media": "1.2.10",
|
|
26
26
|
"winston": "3.11.0",
|