Skip to content
Permalink
Browse files

fix: Remove unneeded htaccess rules and resolve invalid user as default

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
  • Loading branch information...
Richienb committed Jun 23, 2019
1 parent 8a47aa0 commit 784b4a9b6b1d5f93d6e4c06d314dd1eaa6cc6c3c
Showing with 10 additions and 19 deletions.
  1. +1 −17 .htaccess
  2. +4 −2 middleware/load-user.js
  3. +5 −0 users/www.json
@@ -1,21 +1,5 @@
<IfModule mod_rewrite.c>

# $Id: .htaccess,v 1.3 2006/11/09 09:08:14 remy Exp $
Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteBase /

RewriteRule "(^|/)(CVS|\.svn|\.git)/" - [F]

# strip www. from the domain
# Strip www from the domain
RewriteCond %{HTTP_HOST} ^www\.mit-license\.org$ [NC]
RewriteRule ^(.*)$ http://mit-license.org/$1 [R=301,L]

# if the file or directory exists
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .* - [L]

# using 'index.php' because it forces a '/' request to the handler
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
@@ -22,8 +22,10 @@ module.exports = async (req, res, next) => {
);
res.locals.user = {...res.locals.user, ...JSON.parse(data)};
} catch ({code, message}) {
res.code(500).send(`An internal error occurred - open an issue on https://github.com/remy/mit-license with the following information: ${message}`)
return;
if (code !== 'ENOENT') {
res.code(500).send(`An internal error occurred - open an issue on https://github.com/remy/mit-license with the following information: ${message}`)
return;
}
}

next();
@@ -0,0 +1,5 @@
{
"//1": "Security holding user",
"//2": "This user is being locked because www is automatically stripped.",
"locked": true
}

0 comments on commit 784b4a9

Please sign in to comment.
You can’t perform that action at this time.