File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " react-storefront" ,
3- "version" : " 7.7.1 " ,
3+ "version" : " 7.7.2 " ,
44 "description" : " Build and deploy e-commerce progressive web apps (PWAs) in record time." ,
55 "module" : " ./index.js" ,
66 "license" : " Apache-2.0" ,
Original file line number Diff line number Diff line change @@ -25,9 +25,18 @@ import fetch from '../fetch'
2525 */
2626export default function fetchFromAPI ( { req, asPath, pathname } ) {
2727 const host = req ? process . env . API_HOST || req . headers [ 'host' ] : ''
28- const protocol = req ? ( host . startsWith ( 'localhost' ) ? 'http://' : 'https://' ) : ''
2928 const [ path , search ] = asPath . split ( '?' )
3029
30+ let protocol = ''
31+
32+ if ( req ) {
33+ protocol = 'https://'
34+
35+ if ( host . startsWith ( 'localhost' ) || host === '127.0.0.1' ) {
36+ protocol = 'http://'
37+ }
38+ }
39+
3140 let uri = `/api${ path . replace ( / \/ $ / , '' ) } `
3241
3342 if ( search ) {
You can’t perform that action at this time.
0 commit comments