@@ -26,7 +26,7 @@ import {
2626 GaxiosResponse ,
2727 GaxiosPromise ,
2828} from '../src' ;
29- import { GAXIOS_ERROR_SYMBOL } from '../src/common' ;
29+ import { GAXIOS_ERROR_SYMBOL , Headers } from '../src/common' ;
3030import { pkg } from '../src/util' ;
3131import qs from 'querystring' ;
3232import fs from 'fs' ;
@@ -772,8 +772,11 @@ describe('🎏 data handling', () => {
772772
773773 const config : GaxiosOptions = {
774774 headers : {
775- authentication : 'My Auth' ,
776- authorization : 'My Auth' ,
775+ Authentication : 'My Auth' ,
776+ /**
777+ * Ensure casing is properly handled
778+ */
779+ AUTHORIZATION : 'My Auth' ,
777780 'content-type' : 'application/x-www-form-urlencoded' ,
778781 random : 'data' ,
779782 } ,
@@ -821,8 +824,8 @@ describe('🎏 data handling', () => {
821824 assert ( e . config . headers ) ;
822825 assert . deepStrictEqual ( e . config . headers , {
823826 ...config . headers , // non-redactables should be present
824- authentication : REDACT ,
825- authorization : REDACT ,
827+ Authentication : REDACT ,
828+ AUTHORIZATION : REDACT ,
826829 } ) ;
827830
828831 // config redactions - data
@@ -847,11 +850,17 @@ describe('🎏 data handling', () => {
847850 // response redactions
848851 assert ( e . response ) ;
849852 assert . deepStrictEqual ( e . response . config , e . config ) ;
850- assert . deepStrictEqual ( e . response . headers , {
853+
854+ const expectedHeaders : Headers = {
851855 ...responseHeaders , // non-redactables should be present
852856 authentication : REDACT ,
853857 authorization : REDACT ,
854- } ) ;
858+ } ;
859+
860+ delete expectedHeaders [ 'AUTHORIZATION' ] ;
861+ delete expectedHeaders [ 'Authentication' ] ;
862+
863+ assert . deepStrictEqual ( e . response . headers , expectedHeaders ) ;
855864 assert . deepStrictEqual ( e . response . data , {
856865 ...response , // non-redactables should be present
857866 assertion : REDACT ,
0 commit comments