MCPcopy
hub / github.com/MagicMirrorOrg/MagicMirror / geExpectedReceivedHeaders

Function geExpectedReceivedHeaders

js/server_functions.js:173–183  ·  view source on GitHub ↗

* Gets the headers expected from the response. * @param {string} url - The url containing the expected headers from the response. * @returns {string[]} headers - The name of the expected headers.

(url)

Source from the content-addressed store, hash-verified

171 * @returns {string[]} headers - The name of the expected headers.
172 */
173function geExpectedReceivedHeaders (url) {
174 const expectedReceivedHeaders = ["Content-Type"];
175 const expectedReceivedHeadersMatch = new RegExp("expectedheaders=(.+?)(&|$)", "g").exec(url);
176 if (expectedReceivedHeadersMatch) {
177 const headers = expectedReceivedHeadersMatch[1].split(",");
178 for (const header of headers) {
179 expectedReceivedHeaders.push(header);
180 }
181 }
182 return expectedReceivedHeaders;
183}
184
185/**
186 * Gets the HTML to display the magic mirror.

Callers 1

corsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected