Skip to content

Commit 247e5af

Browse files
committed
fix: exclude stackHeaders from entry data assignment
Previously, if an entry contained stackHeaders, it would overwrite the existing stack headers. If tokens were updated in the meantime, this could result in an authorization error.
1 parent 26da7a6 commit 247e5af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/stack/contentType/entry/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export function Entry (http, data) {
2929
if (this.apiVersion && !this.stackHeaders.api_version) {
3030
this.stackHeaders.api_version = this.apiVersion;
3131
}
32-
Object.assign(this, cloneDeep(data.entry))
32+
const { stackHeaders, ...entryData } = data.entry;
33+
Object.assign(this, cloneDeep(entryData));
3334
this.urlPath = `/content_types/${this.content_type_uid}/entries/${this.uid}`
3435

3536
/**

0 commit comments

Comments
 (0)