Compare commits

...

4 Commits

Author SHA1 Message Date
Danny Coates
f690e4a705 v3.0.6 2019-03-14 13:19:25 -07:00
Danny Coates
3e14d3049d only index / route 2019-03-14 13:17:47 -07:00
Danny Coates
6a6f8b86e4 v3.0.5 2019-03-14 12:04:01 -07:00
Danny Coates
c4891c3866 fixed req.route bug when no routes match 2019-03-14 12:02:36 -07:00
4 changed files with 8 additions and 7 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "firefox-send",
"version": "3.0.4",
"version": "3.0.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,7 +1,7 @@
{
"name": "firefox-send",
"description": "File Sharing Experiment",
"version": "3.0.4",
"version": "3.0.6",
"author": "Mozilla (https://mozilla.org)",
"repository": "mozilla/send",
"homepage": "https://github.com/mozilla/send/",

View File

@@ -9,10 +9,7 @@ module.exports = function(state, body = '') {
<head>
<title>${state.title}</title>
<base href="/" />
<meta
name="robots"
content="${state.route === 'download/:id' ? 'none' : 'all'},noarchive"
/>
<meta name="robots" content="${state.robots},noarchive" />
<meta name="google" content="nositelinkssearchbox" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8" />

View File

@@ -7,6 +7,10 @@ const { getFxaConfig } = require('./fxa');
module.exports = async function(req) {
const locale = req.language || 'en-US';
let authConfig = null;
let robots = 'none';
if (req.route && req.route.path === '/') {
robots = 'all';
}
if (config.fxa_client_id) {
try {
authConfig = await getFxaConfig();
@@ -33,7 +37,7 @@ module.exports = async function(req) {
fileInfo: {},
cspNonce: req.cspNonce,
user: { avatar: assets.get('user.svg'), loggedIn: false },
route: req.route.path,
robots,
authConfig,
layout
};