This repository was archived by the owner on Sep 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +295
-310
lines changed
Expand file tree Collapse file tree 2 files changed +295
-310
lines changed Original file line number Diff line number Diff line change @@ -91,10 +91,10 @@ export class DgraphClientStub {
9191 }
9292
9393 public query ( req : Request ) : Promise < Response > {
94- const headers = Object . assign (
95- { } ,
96- this . options . headers !== undefined ? this . options . headers : { } ,
97- ) ;
94+ const headers =
95+ this . options . headers !== undefined
96+ ? { ... this . options . headers }
97+ : { } ;
9898 if ( req . vars !== undefined ) {
9999 if ( this . legacyApi ) {
100100 headers [ "X-Dgraph-Vars" ] = JSON . stringify ( req . vars ) ;
@@ -227,13 +227,10 @@ export class DgraphClientStub {
227227 return Promise . reject ( "Mutation has no data" ) ;
228228 }
229229
230- const headers = Object . assign (
231- { } ,
232- this . options . headers !== undefined ? this . options . headers : { } ,
233- {
234- "Content-Type" : `application/${ usingJSON ? "json" : "rdf" } ` ,
235- } ,
236- ) ;
230+ const headers = {
231+ ...( this . options . headers !== undefined ? this . options . headers : { } ) ,
232+ "Content-Type" : `application/${ usingJSON ? "json" : "rdf" } ` ,
233+ } ;
237234
238235 if ( usingJSON && this . legacyApi ) {
239236 headers [ "X-Dgraph-MutationType" ] = "json" ;
You can’t perform that action at this time.
0 commit comments