@dev-anywhere/proxy 0.4.78 → 0.4.80
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/dist/serve.js +3 -1
- package/dist/serve.js.map +1 -1
- package/package.json +3 -3
package/dist/serve.js
CHANGED
|
@@ -5766,6 +5766,7 @@ import { basename } from "path";
|
|
|
5766
5766
|
|
|
5767
5767
|
// src/serve/remote-file-path.ts
|
|
5768
5768
|
import { realpathSync } from "fs";
|
|
5769
|
+
import { homedir as homedir6 } from "os";
|
|
5769
5770
|
import { extname as extname2, isAbsolute as isAbsolute4, resolve as resolve2 } from "path";
|
|
5770
5771
|
var EXT_MIME_MAP = {
|
|
5771
5772
|
".png": "image/png",
|
|
@@ -5800,7 +5801,8 @@ function guessMimeType(filePath) {
|
|
|
5800
5801
|
return EXT_MIME_MAP[ext] ?? "application/octet-stream";
|
|
5801
5802
|
}
|
|
5802
5803
|
function resolveRemoteFilePath(rawPath, cwd) {
|
|
5803
|
-
const
|
|
5804
|
+
const expandedPath = rawPath === "~" || rawPath.startsWith("~/") ? resolve2(homedir6(), rawPath.slice(2)) : rawPath;
|
|
5805
|
+
const candidate = isAbsolute4(expandedPath) ? resolve2(expandedPath) : resolve2(cwd, expandedPath);
|
|
5804
5806
|
return realpathSync(candidate);
|
|
5805
5807
|
}
|
|
5806
5808
|
|