File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -770,14 +770,9 @@ export const X_HEADERS_TO_REMOVE_PROXY: string[] = ['x-mobify-access-key'];
770770
771771const X_SFDC_ACCESS_CONTROL = 'x-sfdc-access-control' ;
772772
773- export const DEFAULT_ACCESS_CONTROL_FORWARDING_HOSTNAMES : string [ ] = [
774- '.commercecloud.salesforce.com' ,
775- ] ;
773+ export const DEFAULT_ACCESS_CONTROL_FORWARDING_HOSTNAMES : string [ ] = [ '.commercecloud.salesforce.com' ] ;
776774
777- export const hostnameMatchesTransformationList = (
778- hostname : string ,
779- hostnameSuffixes ?: string [ ] | null ,
780- ) : boolean => {
775+ export const hostnameMatchesTransformationList = ( hostname : string , hostnameSuffixes ?: string [ ] | null ) : boolean => {
781776 if ( ! hostnameSuffixes || hostnameSuffixes . length === 0 ) {
782777 return false ;
783778 }
@@ -891,7 +886,7 @@ export const rewriteProxyRequestHeaders = ({
891886 targetHost,
892887 logging = false ,
893888 accessControlHeaderForwardingHostnames,
894- preserveUserAgent = false ,
889+ preserveUserAgent = true ,
895890} : RewriteProxyRequestHeadersParams ) : AWSHeaders | HTTPHeaders | IncomingHttpHeaders => {
896891 if ( ! headers ) {
897892 return { } ;
Original file line number Diff line number Diff line change @@ -805,13 +805,13 @@ describe('rewriteProxyRequestHeaders tests', () => {
805805 } ,
806806 } ,
807807 {
808- name : 'overwrites User-Agent when preserveUserAgent is undefined (default)' ,
808+ name : 'preserves User-Agent when preserveUserAgent is undefined (default is true )' ,
809809 targetHost : 'www.customer.com' ,
810810 input : {
811811 'user-agent' : 'Mozilla/5.0 (Macintosh; Intel Mac OS X)' ,
812812 } ,
813813 expected : {
814- 'user-agent' : 'Amazon CloudFront ' ,
814+ 'user-agent' : 'Mozilla/5.0 (Macintosh; Intel Mac OS X) ' ,
815815 } ,
816816 } ,
817817 {
@@ -901,8 +901,8 @@ describe('hostnameMatchesTransformationList', () => {
901901 } ) ;
902902
903903 it ( 'returns true when hostname ends with a suffix' , ( ) => {
904- expect ( hostnameMatchesTransformationList ( 'api.commercecloud.salesforce.com' , [ '.commercecloud.salesforce.com' ] ) )
905- . to . be . true ;
904+ expect ( hostnameMatchesTransformationList ( 'api.commercecloud.salesforce.com' , [ '.commercecloud.salesforce.com' ] ) ) . to
905+ . be . true ;
906906 } ) ;
907907
908908 it ( 'returns true with multiple suffixes' , ( ) => {
You can’t perform that action at this time.
0 commit comments