找出这段生成缓存包装器中的版本隔离缺陷。
JavaScript
function serve(headers, cache) {
const version = headers["x-api-version"] || "v1";
const key = "/orders/ord-7";
if (cache.has(key)) return cache.get(key);
const body = version === "v1"
? { id: "ord-7", total: 25.99 }
: { id: "ord-7", total: { amount: "25.99", currency: "USD" } };
cache.set(key, body);
return body;
}