Skip to content
Permalink
Browse files

Fix nuxt-community#56

  • Loading branch information...
Timkor committed Apr 29, 2019
1 parent 5d029a2 commit 8180acdd82c7477891e93a12b5e676b7430cf69f
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/module.js
@@ -18,7 +18,8 @@ module.exports = function module (moduleOptions) {
cacheTime: 1000 * 60 * 15,
filter: undefined,
gzip: false,
defaults: {}
defaults: {},
forceHttps: false,
}

const options = Object.assign({}, defaults, this.options.sitemap, moduleOptions)
@@ -149,7 +150,7 @@ function createSitemap (options, routes, req) {

// Set sitemap hostname
sitemapConfig.hostname = options.hostname ||
(req && `${isHTTPS(req) ? 'https' : 'http'}://${req.headers.host}`) || `http://${hostname()}`
(req && `${(options.forceHttps || isHTTPS(req)) ? 'https' : 'http'}://${req.headers.host}`) || `http://${hostname()}`

routes = routes.map(route => Object.assign({}, options.defaults, route))

0 comments on commit 8180acd

Please sign in to comment.
You can’t perform that action at this time.