parent
81cc5a8323
commit
4684e28fdb
3 changed files with 4 additions and 15 deletions
|
@ -58,11 +58,7 @@ const autoblockPublishBodyMiddleware = (req, res, next) => {
|
||||||
let ip = (req.headers['x-forwarded-for'] || req.connection.remoteAddress).split(/,\s?/)[0];
|
let ip = (req.headers['x-forwarded-for'] || req.connection.remoteAddress).split(/,\s?/)[0];
|
||||||
const { channelName } = req.body;
|
const { channelName } = req.body;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (channelName && publishingChannelWhitelist.indexOf(channelName.toLowerCase()) !== -1) {
|
if (channelName && publishingChannelWhitelist.indexOf(channelName.toLowerCase()) !== -1) {
|
||||||
=======
|
|
||||||
if (channelName && publishingChannelWhitelist.indexOf(channelName) !== -1) {
|
|
||||||
>>>>>>> run eslint pre-hook
|
|
||||||
delete ipCounts[ip];
|
delete ipCounts[ip];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,11 +27,7 @@ function logMetricsMiddleware (req, res, next) {
|
||||||
|
|
||||||
db.Metrics.create({
|
db.Metrics.create({
|
||||||
time : Date.now(),
|
time : Date.now(),
|
||||||
<<<<<<< HEAD
|
|
||||||
isInternal: /node-fetch/.test(userAgent),
|
isInternal: /node-fetch/.test(userAgent),
|
||||||
=======
|
|
||||||
isInternal: /node\-fetch/.test(userAgent),
|
|
||||||
>>>>>>> run eslint pre-hook
|
|
||||||
isChannel : res.isChannel,
|
isChannel : res.isChannel,
|
||||||
claimId : res.claimId,
|
claimId : res.claimId,
|
||||||
routePath : httpContext.get('routePath'),
|
routePath : httpContext.get('routePath'),
|
||||||
|
|
|
@ -53,23 +53,20 @@ module.exports = (req, res) => {
|
||||||
const runSaga = (action !== false && saga !== false);
|
const runSaga = (action !== false && saga !== false);
|
||||||
|
|
||||||
const renderPage = (store) => {
|
const renderPage = (store) => {
|
||||||
|
|
||||||
// Workaround, remove when a solution for async httpContext exists
|
// Workaround, remove when a solution for async httpContext exists
|
||||||
const showState = store.getState().show;
|
const showState = store.getState().show;
|
||||||
const assetKeys = Object.keys(showState.assetList);
|
const assetKeys = Object.keys(showState.assetList);
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
if(assetKeys.length !== 0) {
|
if(assetKeys.length !== 0) {
|
||||||
=======
|
|
||||||
if (assetKeys.length !== 0) {
|
|
||||||
>>>>>>> run eslint pre-hook
|
|
||||||
res.claimId = showState.assetList[assetKeys[0]].claimId;
|
res.claimId = showState.assetList[assetKeys[0]].claimId;
|
||||||
} else {
|
} else {
|
||||||
const channelKeys = Object.keys(showState.channelList);
|
const channelKeys = Object.keys(showState.channelList);
|
||||||
|
|
||||||
if (channelKeys.length !== 0) {
|
if(channelKeys.length !== 0) {
|
||||||
res.claimId = showState.channelList[channelKeys[0]].longId;
|
res.claimId = showState.channelList[channelKeys[0]].longId;
|
||||||
res.isChannel = true;
|
res.isChannel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// render component to a string
|
// render component to a string
|
||||||
|
@ -122,7 +119,7 @@ module.exports = (req, res) => {
|
||||||
console.log(`redirecting ${req.originalUrl} to ${canonicalUrl}`);
|
console.log(`redirecting ${req.originalUrl} to ${canonicalUrl}`);
|
||||||
res.redirect(canonicalUrl);
|
res.redirect(canonicalUrl);
|
||||||
}
|
}
|
||||||
return renderPage(store);
|
return renderPage(store)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const store = createStore(Reducers);
|
const store = createStore(Reducers);
|
||||||
|
|
Loading…
Add table
Reference in a new issue