forcing update when querying the terms, and fixing bug in request header parsing
This commit is contained in:
parent
bc817a638d
commit
ac60a0559c
@ -441,6 +441,7 @@ async function getExchangeTos(
|
|||||||
ws,
|
ws,
|
||||||
exchangeBaseUrl,
|
exchangeBaseUrl,
|
||||||
acceptedFormat,
|
acceptedFormat,
|
||||||
|
true,
|
||||||
);
|
);
|
||||||
const content = exchangeDetails.termsOfServiceText;
|
const content = exchangeDetails.termsOfServiceText;
|
||||||
const currentEtag = exchangeDetails.termsOfServiceLastEtag;
|
const currentEtag = exchangeDetails.termsOfServiceLastEtag;
|
||||||
|
@ -45,8 +45,9 @@ export class ServiceWorkerHttpLib implements HttpRequestLibrary {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const headerMap = new Headers();
|
const headerMap = new Headers();
|
||||||
response.headers.forEach(addLineToMap(headerMap));
|
response.headers.forEach((value, key) => {
|
||||||
|
headerMap.set(key, value);
|
||||||
|
})
|
||||||
return {
|
return {
|
||||||
headers: headerMap,
|
headers: headerMap,
|
||||||
status: response.status,
|
status: response.status,
|
||||||
@ -132,15 +133,3 @@ function makeJsonHandler(response: Response, requestUrl: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addLineToMap(map: { set(k: string, v: string): void }) {
|
|
||||||
return (line: string) => {
|
|
||||||
const parts = line.split(": ");
|
|
||||||
const headerName = parts.shift();
|
|
||||||
if (!headerName) {
|
|
||||||
logger.warn("skipping invalid header");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const value = parts.join(": ");
|
|
||||||
map.set(headerName, value);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user