awscdk-construct-scte-scheduler
Version:
AWS CDK Construct for scheduling SCTE-35 events using the MediaLive schedule API
18 lines (17 loc) • 589 B
JavaScript
import { parseUrl } from "@smithy/core/protocols";
export const toEndpointV1 = (endpoint) => {
if (typeof endpoint === "object") {
if ("url" in endpoint) {
const v1Endpoint = parseUrl(endpoint.url);
if (endpoint.headers) {
v1Endpoint.headers = {};
for (const name in endpoint.headers) {
v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
}
}
return v1Endpoint;
}
return endpoint;
}
return parseUrl(endpoint);
};