Rocky_Mountain_Vending/.pnpm-store/v10/files/20/96b1969a048e447d0808fcdd0ab80a728562cbad4cd7ce787526a976d7ad249d29ba8eae105579ab1519b53a2f7e76d94b7c6c0472c4a66dc10d9333669e6c
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

32 lines
1.4 KiB
Text

import { HttpRequest } from "@smithy/protocol-http";
import { NoOpLogger } from "@smithy/smithy-client";
const CONTENT_LENGTH_HEADER = "content-length";
const DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length";
export function checkContentLengthHeader() {
return (next, context) => async (args) => {
const { request } = args;
if (HttpRequest.isInstance(request)) {
if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) {
const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`;
if (typeof context?.logger?.warn === "function" && !(context.logger instanceof NoOpLogger)) {
context.logger.warn(message);
}
else {
console.warn(message);
}
}
}
return next({ ...args });
};
}
export const checkContentLengthHeaderMiddlewareOptions = {
step: "finalizeRequest",
tags: ["CHECK_CONTENT_LENGTH_HEADER"],
name: "getCheckContentLengthHeaderPlugin",
override: true,
};
export const getCheckContentLengthHeaderPlugin = (unused) => ({
applyToStack: (clientStack) => {
clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions);
},
});