Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Luc Bourdot
codimd
Commits
9fd5c86b
Commit
9fd5c86b
authored
Dec 27, 2016
by
Max Wu
Committed by
GitHub
Dec 27, 2016
Browse files
Merge pull request #302 from knjcode/url_resolve
Fix URL concatenation when uploading images to local filesystem
parents
f2a79f9a
a2fbb3ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
app.js
View file @
9fd5c86b
...
...
@@ -11,6 +11,7 @@ var compression = require('compression')
var
session
=
require
(
'
express-session
'
);
var
SequelizeStore
=
require
(
'
connect-session-sequelize
'
)(
session
.
Store
);
var
fs
=
require
(
'
fs
'
);
var
url
=
require
(
'
url
'
);
var
path
=
require
(
'
path
'
);
var
imgur
=
require
(
'
imgur
'
);
var
formidable
=
require
(
'
formidable
'
);
...
...
@@ -487,7 +488,7 @@ app.post('/uploadimage', function (req, res) {
switch
(
config
.
imageUploadType
)
{
case
'
filesystem
'
:
res
.
send
({
link
:
path
.
join
(
config
.
serverurl
,
files
.
image
.
path
.
match
(
/^public
(
.+$
)
/
)[
1
])
link
:
url
.
resolve
(
config
.
serverurl
,
files
.
image
.
path
.
match
(
/^public
(
.+$
)
/
)[
1
])
});
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment