* 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)
| 171 | * @returns {string[]} headers - The name of the expected headers. |
| 172 | */ |
| 173 | function 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. |