Skip to content

Commit

Permalink
feat: disable https for localhost url (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahtnif authored and pi0 committed Mar 5, 2018
1 parent fe16981 commit dd67734
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = function nuxtAxios (_moduleOptions) {

// Convert http:// to https:// if https option is on
if (options.https === true) {
const https = s => s.replace('http://', 'https://')
const https = s => s.indexOf('//localhost:') > -1 ? s : s.replace('http://', 'https://')
options.baseURL = https(options.baseURL)
options.browserBaseURL = https(options.browserBaseURL)
}
Expand Down

2 comments on commit dd67734

@blowsie
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

@pi0 pi0 commented on dd67734 Mar 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.