Skip to content

Commit dd67734

Browse files
yahtnifpi0
authored andcommittedMar 5, 2018
feat: disable https for localhost url (#93)
1 parent fe16981 commit dd67734

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/module.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports = function nuxtAxios (_moduleOptions) {
7171

7272
// Convert http:// to https:// if https option is on
7373
if (options.https === true) {
74-
const https = s => s.replace('http://', 'https://')
74+
const https = s => s.indexOf('//localhost:') > -1 ? s : s.replace('http://', 'https://')
7575
options.baseURL = https(options.baseURL)
7676
options.browserBaseURL = https(options.browserBaseURL)
7777
}

2 commit comments

Comments
 (2)

blowsie commented on Mar 16, 2020

@blowsie
Contributor

Im not sure why this have been implemented but it feels like a developer issue to me. What if someone wants to use https on localhost?

pi0 commented on Mar 17, 2020

@pi0
Member

Hi @blowsie. I'm kinda biased about this. Default values and convent options like https are also about developer experience to reduce dev issues (which mostly don't use https for localhost)

Please sign in to comment.