Rocky_Mountain_Vending/.pnpm-store/v10/files/d2/a0b9a8770326097f00eded389c16f2fa261fee9db7c8e233ff4a3735edaa5e15c5ca7c542642043843f0d6105ff7b82dc7460f59eadcf27a6987be0943d447
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

33 lines
1.1 KiB
Text

import { HttpRequest } from "@smithy/protocol-http";
export function resolveHostHeaderConfig(input) {
return input;
}
export const hostHeaderMiddleware = (options) => (next) => async (args) => {
if (!HttpRequest.isInstance(args.request))
return next(args);
const { request } = args;
const { handlerProtocol = "" } = options.requestHandler.metadata || {};
if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
delete request.headers["host"];
request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
}
else if (!request.headers["host"]) {
let host = request.hostname;
if (request.port != null)
host += `:${request.port}`;
request.headers["host"] = host;
}
return next(args);
};
export const hostHeaderMiddlewareOptions = {
name: "hostHeaderMiddleware",
step: "build",
priority: "low",
tags: ["HOST"],
override: true,
};
export const getHostHeaderPlugin = (options) => ({
applyToStack: (clientStack) => {
clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
},
});