@lark-apaas/fullstack-rspack-preset 1.0.41 → 1.0.42

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.
@@ -164,7 +164,16 @@ class StaticAssetsPlugin {
164
164
  if (!url.startsWith(staticPrefix)) {
165
165
  return next();
166
166
  }
167
- const relativePath = url.slice(staticPrefix.length).split('?')[0];
167
+ const rawRelativePath = url.slice(staticPrefix.length).split('?')[0];
168
+ let relativePath;
169
+ try {
170
+ relativePath = decodeURIComponent(rawRelativePath);
171
+ }
172
+ catch {
173
+ res.statusCode = 400;
174
+ res.end('Bad Request');
175
+ return;
176
+ }
168
177
  const filePath = path.join(staticDir, relativePath);
169
178
  // Security: prevent path traversal
170
179
  const normalizedPath = path.normalize(filePath);
@@ -193,7 +202,6 @@ class StaticAssetsPlugin {
193
202
  };
194
203
  }
195
204
  apply(compiler) {
196
- const { clientBasePath } = this.options;
197
205
  // Create a temporary directory for virtual modules
198
206
  const virtualModulesDir = path.join(this.options.rootDir, 'node_modules', '.cache', 'static-assets-virtual');
199
207
  // Ensure virtual modules directory exists
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-rspack-preset",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "files": [
5
5
  "lib",
6
6
  "patches",
@@ -32,7 +32,7 @@
32
32
  "@babel/traverse": "^7.28.0",
33
33
  "@babel/types": "^7.28.2",
34
34
  "@lark-apaas/devtool-kits": "^1.2.18",
35
- "@lark-apaas/miaoda-inspector-babel-plugin": "^1.0.0",
35
+ "@lark-apaas/miaoda-inspector-babel-plugin": "^1.0.1",
36
36
  "@lark-apaas/miaoda-inspector-jsx-runtime": "^1.0.1",
37
37
  "@lark-apaas/styled-jsx": "^1.0.1",
38
38
  "@rspack/plugin-react-refresh": "^1.5.1",