fix: Final restoration with port 80
✅ COMPLETED: 1. Dockerfile uses port 80 (astro preview) 2. BaseLayout imports globals.css 3. globals.css with Tailwind v4 @theme syntax 4. index.astro has Header, Footer, FixedContact 5. All image references fixed to existing files 6. Hero uses hdpe_pipe_main.jpg 7. Product cards use hdpe001.jpg 8. pt-20 on main for fixed header ✅ TESTED LOCALLY: - Build: 15 pages in 1.27s - Docker build successful - Port 80 working - Images load - CSS works Ready for Easypanel deployment.
This commit is contained in:
73
node_modules/astro/dist/assets/utils/remoteProbe.js
generated
vendored
Normal file
73
node_modules/astro/dist/assets/utils/remoteProbe.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
import { isRemoteAllowed } from "@astrojs/internal-helpers/remote";
|
||||
import { AstroError, AstroErrorData } from "../../core/errors/index.js";
|
||||
import { imageMetadata } from "./metadata.js";
|
||||
async function inferRemoteSize(url, imageConfig) {
|
||||
if (!URL.canParse(url)) {
|
||||
throw new AstroError({
|
||||
...AstroErrorData.FailedToFetchRemoteImageDimensions,
|
||||
message: AstroErrorData.FailedToFetchRemoteImageDimensions.message(url)
|
||||
});
|
||||
}
|
||||
const allowlistConfig = imageConfig ? {
|
||||
domains: imageConfig.domains ?? [],
|
||||
remotePatterns: imageConfig.remotePatterns ?? []
|
||||
} : void 0;
|
||||
if (!allowlistConfig) {
|
||||
const parsedUrl = new URL(url);
|
||||
if (!["http:", "https:"].includes(parsedUrl.protocol)) {
|
||||
throw new AstroError({
|
||||
...AstroErrorData.FailedToFetchRemoteImageDimensions,
|
||||
message: AstroErrorData.FailedToFetchRemoteImageDimensions.message(url)
|
||||
});
|
||||
}
|
||||
}
|
||||
if (allowlistConfig && !isRemoteAllowed(url, allowlistConfig)) {
|
||||
throw new AstroError({
|
||||
...AstroErrorData.RemoteImageNotAllowed,
|
||||
message: AstroErrorData.RemoteImageNotAllowed.message(url)
|
||||
});
|
||||
}
|
||||
const response = await fetch(url, { redirect: "manual" });
|
||||
if (response.status >= 300 && response.status < 400) {
|
||||
throw new AstroError({
|
||||
...AstroErrorData.FailedToFetchRemoteImageDimensions,
|
||||
message: AstroErrorData.FailedToFetchRemoteImageDimensions.message(url)
|
||||
});
|
||||
}
|
||||
if (!response.body || !response.ok) {
|
||||
throw new AstroError({
|
||||
...AstroErrorData.FailedToFetchRemoteImageDimensions,
|
||||
message: AstroErrorData.FailedToFetchRemoteImageDimensions.message(url)
|
||||
});
|
||||
}
|
||||
const reader = response.body.getReader();
|
||||
let done, value;
|
||||
let accumulatedChunks = new Uint8Array();
|
||||
while (!done) {
|
||||
const readResult = await reader.read();
|
||||
done = readResult.done;
|
||||
if (done) break;
|
||||
if (readResult.value) {
|
||||
value = readResult.value;
|
||||
let tmp = new Uint8Array(accumulatedChunks.length + value.length);
|
||||
tmp.set(accumulatedChunks, 0);
|
||||
tmp.set(value, accumulatedChunks.length);
|
||||
accumulatedChunks = tmp;
|
||||
try {
|
||||
const dimensions = await imageMetadata(accumulatedChunks, url);
|
||||
if (dimensions) {
|
||||
await reader.cancel();
|
||||
return dimensions;
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new AstroError({
|
||||
...AstroErrorData.NoImageMetadata,
|
||||
message: AstroErrorData.NoImageMetadata.message(url)
|
||||
});
|
||||
}
|
||||
export {
|
||||
inferRemoteSize
|
||||
};
|
||||
Reference in New Issue
Block a user