persona-community-5/.pnpm-store/v3/files/3a/29f57bef2496e4db0302402b859f186a8042bce703839df445f4ece94e5feb550e04cacdaf755ada68f115ac9332d23b3bcddff1466727a155e0039cbec163
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

30 lines
1.3 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResponseContainsHeader = void 0;
const utils_1 = require("../../utils");
const ResponseContainsHeader = (options) => {
const names = options.names || {};
return {
Operation: {
Response: {
enter: (response, { report, location, key }) => {
const expectedHeaders = names[key] ||
names[(0, utils_1.getMatchingStatusCodeRange)(key)] ||
names[(0, utils_1.getMatchingStatusCodeRange)(key).toLowerCase()] ||
[];
for (const expectedHeader of expectedHeaders) {
if (!response?.headers ||
!Object.keys(response?.headers).some((header) => header.toLowerCase() === expectedHeader.toLowerCase())) {
report({
message: `Response object must contain a "${expectedHeader}" header.`,
location: location.child('headers').key(),
});
}
}
},
},
},
};
};
exports.ResponseContainsHeader = ResponseContainsHeader;