Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(module): always set protocol to https when https: true is set #344

Merged
merged 2 commits into from
Mar 27, 2020

Conversation

blowsie
Copy link
Contributor

@blowsie blowsie commented Mar 16, 2020

HTTPS on localhost is not possible because of this change.
#93

There is no justification as to why this change has been made.

To me it feels like a developer issue and what should have been done is something along the lines of this in the config.

https: process.env.NODE_ENV === 'development',

As it stands at the moments the https setting is redundant in localhost and the limitation is not well documented

https://cmty.app/nuxt/axios-module/issues/c346

@pi0
Copy link
Member

pi0 commented Mar 17, 2020

Hi @blowsie. I fully understand. But as already mentioned dd67734#commitcomment-37868019, https options is a shortcut to automatically enable https for baseURL on non-dev environments it is certainly something missing from docs and i think we probably need to deprecate and remove it with next releases as can be confusing.

If you need https always on, you can already directly set it for baseURL option otherwise would be happy to hear more about your current setup.

@blowsie
Copy link
Contributor Author

blowsie commented Mar 17, 2020

In my experience, non dev environments often use localhost and https.
As I said i feel this change was just added to address one developers problems, potentially at the cost of wasting the time of others, epscially since its not reflected in the docs.

Please do what you will, I was just trying to help.

@blowsie blowsie closed this Mar 17, 2020
@pi0
Copy link
Member

pi0 commented Mar 17, 2020

@blowsie I'm sorry made you feel like that. Features to OSS are added by individual developers. Both https and check for localhost was added so. Properly discussing ensures we add things that are best for most users that's why I asked for your current setup.

In my experience, non-dev environments often use localhost and https

localhost is a secure origin itself why often need https for API calls to localhost?

@hareku
Copy link
Contributor

hareku commented Mar 26, 2020

@pi0
I use https://localhost because I want to test the secure option of cookies in dev env.
Also baseUrl does not work when proxy is enabled, so I have to enable https even localhost.

@blowsie
Copy link
Contributor Author

blowsie commented Mar 26, 2020

Yes same for me I run HTTPs locally to test CSP and HTTPS cookies

@pi0 pi0 changed the title fix(https): https does not work on localhost fix: always set protocol to https when https: true is set Mar 27, 2020
@pi0 pi0 reopened this Mar 27, 2020
@codecov
Copy link

codecov bot commented Mar 27, 2020

Codecov Report

Merging #344 into dev will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev      #344   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           30        30           
  Branches        13        12    -1     
=========================================
  Hits            30        30           
Impacted Files Coverage Δ
lib/module.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6f88ae...4917dd1. Read the comment docs.

@pi0 pi0 changed the title fix: always set protocol to https when https: true is set fix(module): always set protocol to https when https: true is set Mar 27, 2020
@pi0 pi0 merged commit 6f82570 into nuxt-community:dev Mar 27, 2020
@pi0
Copy link
Member

pi0 commented Mar 27, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants