[FIX] website_event_track_online: miss-assigned var. in ServiceWorker

When caching a POST request a cache key is builded based on a serialized
version of the request... but the serialization wasn't properly
performed.

This commit properly assigns the `serializedRequest` variable before
attempting to build the cache key.

This was due to a miss-extraction of that variable (see commit
odoo/odoo@f538a551b1 ).

closes odoo/odoo#56049

X-original-commit: 30c99d9fe49cf864687b1f9c7cc887b169698b66
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
This commit is contained in:
Pierre Paridans
2020-08-18 11:05:27 +00:00
parent 8f836fd9a7
commit 14a73fa1df
@@ -130,6 +130,7 @@ const cacheRequest = async (request, response) => {
const cache = await caches.open(cacheName);
await cache.put(request, response.clone());
} else if (isCachableURL(request.url)) {
const serializedRequest = await serializeRequest(request);
const serializedResponse = await serializeResponse(response.clone());
await set(buildCacheKey(serializedRequest), serializedResponse, cacheStore);
}