nuxt / http

Universal HTTP Module for Nuxt.js
https://http.nuxtjs.org
MIT License
229 stars 51 forks source link

fix: don't default to localhost in production #72

Closed galvez closed 4 years ago

galvez commented 5 years ago

Noticed a live deployment with @nuxt/http was using localhost if no environment variable was set.

codecov-io commented 5 years ago

Codecov Report

Merging #72 into dev will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev      #72   +/-   ##
=======================================
  Coverage   97.05%   97.05%           
=======================================
  Files           1        1           
  Lines          34       34           
  Branches       16       16           
=======================================
  Hits           33       33           
  Misses          1        1
Impacted Files Coverage Δ
lib/module.js 97.05% <100%> (ø) :arrow_up:

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 1674aae...e4ade66. Read the comment docs.

galvez commented 5 years ago

@pi0 erm, still needs a fix -- wait :)

galvez commented 5 years ago

K, fixed it.

galvez commented 5 years ago

Related: https://github.com/nuxt/press/issues/58 -- actually @pi0 would appreciate if you could double check and make sure this is really the issue.

pi0 commented 5 years ago

0.0.0.0 is not a valid IP. Maybe we can use this.options.server.host which handles --host as well.

See related PR for axios module: https://github.com/nuxt-community/axios-module/pull/245

pi0 commented 4 years ago

/reminder @galvez What do you think about proposed change?

galvez commented 4 years ago

Let's do that :)

pi0 commented 4 years ago

Suggestion applied by bc58738c6b1158bd6e6efd45372da9765b8da577. Implementation is now consistent with axios module to support CLI flags or nuxt config if provided.