Stop sending headers twice.
This commit is contained in:
parent
a2c7a51784
commit
a471a984f8
1 changed files with 24 additions and 24 deletions
|
@ -19,9 +19,7 @@ module.exports = function(req, res) {
|
||||||
if (!url.host) {
|
if (!url.host) {
|
||||||
req.flash('search-error', 'Paste a music link above to find and share the matches');
|
req.flash('search-error', 'Paste a music link above to find and share the matches');
|
||||||
res.redirect('/');
|
res.redirect('/');
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
for (var id in services) {
|
for (var id in services) {
|
||||||
var matched = services[id].match(req.body.url);
|
var matched = services[id].match(req.body.url);
|
||||||
if (matched) {
|
if (matched) {
|
||||||
|
@ -30,8 +28,9 @@ module.exports = function(req, res) {
|
||||||
if (!result.id) {
|
if (!result.id) {
|
||||||
req.flash('search-error', 'No match found for this link');
|
req.flash('search-error', 'No match found for this link');
|
||||||
res.redirect('/');
|
res.redirect('/');
|
||||||
}
|
} else {
|
||||||
res.redirect("/" + id + "/" + result.type + "/" + result.id);
|
res.redirect("/" + id + "/" + result.type + "/" + result.id);
|
||||||
|
}
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
if (error.code == "ETIMEDOUT") {
|
if (error.code == "ETIMEDOUT") {
|
||||||
error = new Error("Error talking to music service");
|
error = new Error("Error talking to music service");
|
||||||
|
@ -46,6 +45,7 @@ module.exports = function(req, res) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!searching) {
|
if (!searching) {
|
||||||
req.flash('search-error', 'No match found for this link');
|
req.flash('search-error', 'No match found for this link');
|
||||||
res.redirect('/');
|
res.redirect('/');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue