Rocky_Mountain_Vending/.pnpm-store/v10/files/52/edba656a9f251275193715543e668fa8b8e2e8b4b932e92b450ef3fe4b54c85294cdd329b453e220f5ef4b47d0d8c30311352b426decbe8baf598c5aeb3c7d
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

28 lines
No EOL
1.2 KiB
Text

import { ACTION_HEADER } from '../../client/components/app-router-headers';
export function getServerActionRequestMetadata(req) {
let actionId;
let contentType;
if (req.headers instanceof Headers) {
actionId = req.headers.get(ACTION_HEADER) ?? null;
contentType = req.headers.get('content-type');
} else {
actionId = req.headers[ACTION_HEADER] ?? null;
contentType = req.headers['content-type'] ?? null;
}
const isURLEncodedAction = Boolean(req.method === 'POST' && contentType === 'application/x-www-form-urlencoded');
const isMultipartAction = Boolean(req.method === 'POST' && (contentType == null ? void 0 : contentType.startsWith('multipart/form-data')));
const isFetchAction = Boolean(actionId !== undefined && typeof actionId === 'string' && req.method === 'POST');
const isPossibleServerAction = Boolean(isFetchAction || isURLEncodedAction || isMultipartAction);
return {
actionId,
isURLEncodedAction,
isMultipartAction,
isFetchAction,
isPossibleServerAction
};
}
export function getIsPossibleServerAction(req) {
return getServerActionRequestMetadata(req).isPossibleServerAction;
}
//# sourceMappingURL=server-action-request-meta.js.map