Merge pull request #1103 from SISheogorath/fix/localImageUpload

Fix usage of new URL API
This commit is contained in:
Christoph (Sheogorath) Kern 2018-12-20 22:42:17 +01:00 committed by GitHub
commit f492fea418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
'use strict' 'use strict'
const url = require('url') const URL = require('url').URL
const path = require('path') const path = require('path')
const config = require('../../config') const config = require('../../config')
@ -16,5 +16,5 @@ exports.uploadImage = function (imagePath, callback) {
return return
} }
callback(null, url.URL.resolve(config.serverURL + '/uploads/', path.basename(imagePath))) callback(null, (new URL(path.basename(imagePath), config.serverURL + '/uploads/')).href)
} }