Skip to content

Commit ff0318b

Browse files
committed
refactor
1 parent 1eb33e2 commit ff0318b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/remote-config/remote-config-api-client-internal.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ export class RemoteConfigApiClient {
148148
template = this.validateInputRemoteConfigTemplate(template);
149149
return this.sendServerPutRequest(template, template.etag, true)
150150
.then((resp) => {
151+
// validating a template returns an etag with the suffix -0 means that your update
152+
// was successfully validated. We set the etag back to the original etag of the template
153+
// to allow future operations.
151154
this.validateEtag(resp.headers['etag']);
152155
return this.toRemoteConfigTemplate(resp, template.etag);
153156
})
@@ -163,6 +166,8 @@ export class RemoteConfigApiClient {
163166
template = this.validateInputRemoteConfigTemplate(template);
164167
let ifMatch: string = template.etag;
165168
if (options && options.force === true) {
169+
// setting `If-Match: *` forces the Remote Config template to be updated
170+
// and circumvent the ETag, and the protection from that it provides.
166171
ifMatch = '*';
167172
}
168173
return this.sendServerPutRequest(template, ifMatch)

0 commit comments

Comments
 (0)