Fixed export gist title might null and fake referer that redirect to gist html_url
This commit is contained in:
parent
db86dc7a48
commit
3f2f063e9b
1 changed files with 2 additions and 0 deletions
|
@ -544,6 +544,7 @@ function githubActionGist(req, res, noteId) {
|
||||||
var title = notedata.title;
|
var title = notedata.title;
|
||||||
var decodedTitle = LZString.decompressFromBase64(title);
|
var decodedTitle = LZString.decompressFromBase64(title);
|
||||||
if (decodedTitle) title = decodedTitle;
|
if (decodedTitle) title = decodedTitle;
|
||||||
|
else title = 'Untitled';
|
||||||
var filename = title.replace('/', ' ') + '.md';
|
var filename = title.replace('/', ' ') + '.md';
|
||||||
var gist = {
|
var gist = {
|
||||||
"files": {}
|
"files": {}
|
||||||
|
@ -562,6 +563,7 @@ function githubActionGist(req, res, noteId) {
|
||||||
json: gist
|
json: gist
|
||||||
}, function (error, httpResponse, body) {
|
}, function (error, httpResponse, body) {
|
||||||
if (!error && httpResponse.statusCode == 201) {
|
if (!error && httpResponse.statusCode == 201) {
|
||||||
|
res.setHeader('referer', '');
|
||||||
res.redirect(body.html_url);
|
res.redirect(body.html_url);
|
||||||
} else {
|
} else {
|
||||||
return response.errorForbidden(res);
|
return response.errorForbidden(res);
|
||||||
|
|
Loading…
Reference in a new issue