mirror of https://github.com/sundowndev/http.git
fix lint errors
parent
0047e6fd76
commit
fcc7934610
|
@ -4,7 +4,7 @@ const semver = require('semver')
|
|||
|
||||
const logger = consola.withScope('nuxt:http')
|
||||
|
||||
function httpModule(_moduleOptions) {
|
||||
function httpModule (_moduleOptions) {
|
||||
// Combine options
|
||||
const moduleOptions = { ...this.options.http, ..._moduleOptions }
|
||||
|
||||
|
@ -72,7 +72,7 @@ function httpModule(_moduleOptions) {
|
|||
|
||||
// Convert http:// to https:// if https option is on
|
||||
if (options.https === true) {
|
||||
const https = s => s.indexOf('//localhost:') > -1 ? s : s.replace('http://', 'https://')
|
||||
const https = s => s.includes('//localhost:') ? s : s.replace('http://', 'https://')
|
||||
options.baseURL = https(options.baseURL)
|
||||
options.browserBaseURL = https(options.browserBaseURL)
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ const defaultConfig = require('./fixture/nuxt.config')
|
|||
|
||||
jest.setTimeout(60000)
|
||||
|
||||
async function setupMockNuxt(config) {
|
||||
async function setupMockNuxt (config) {
|
||||
const nuxt = new Nuxt({
|
||||
...defaultConfig,
|
||||
...config,
|
||||
|
@ -24,7 +24,7 @@ async function setupMockNuxt(config) {
|
|||
return nuxt
|
||||
}
|
||||
|
||||
async function setupNuxt(config) {
|
||||
async function setupNuxt (config) {
|
||||
const nuxt = new Nuxt({
|
||||
...defaultConfig,
|
||||
...config,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = {
|
||||
path: '/test_api',
|
||||
handler(req, res) {
|
||||
handler (req, res) {
|
||||
res.end(JSON.stringify({
|
||||
url: req.url,
|
||||
method: req.method
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export default {
|
||||
actions: {
|
||||
nuxtServerInit({ commit }, ctx) {
|
||||
nuxtServerInit ({ commit }, ctx) {
|
||||
if (!ctx.$http) {
|
||||
throw new Error('$http is not defined!')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue