aboutsummaryrefslogtreecommitdiff
path: root/src/app.ts
diff options
context:
space:
mode:
authorcjd242018-04-23 08:43:10 +0100
committercjd242018-04-23 08:43:10 +0100
commitf1e8003fd621a40e2386c310a2189bb9a13b0c9d (patch)
treea0323aa44d4e9ee87bc9b5fb98e769c4af79265d /src/app.ts
parentAdd tabular functionality (except cols) (diff)
downloadmedicine-f1e8003fd621a40e2386c310a2189bb9a13b0c9d.tar.gz
medicine-f1e8003fd621a40e2386c310a2189bb9a13b0c9d.zip

BIG FILTHY COMMIT OF SCARY STUFF

Diffstat (limited to 'src/app.ts')
-rw-r--r--src/app.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/app.ts b/src/app.ts
index a6e0d27..7b398fd 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -82,6 +82,12 @@ class App {
'/cs3099group-be-4/_supported_protocols_'
] })
);
+ this.express.use((req, res, next) => {
+ if (req.headers.authorisation) {
+ (req.headers.authorization as any) = req.headers.authorisation;
+ }
+ next();
+ })
this.express.use(passport.initialize());
this.express.use(async(
req: ex.Request, res: ex.Response, next: ex.NextFunction
@@ -110,7 +116,7 @@ class App {
defRouter.get('/', (req: ex.Request, res: ex.Response): void => {
res.json({
message: 'Welcome to the CS3099 BE4 server!',
- important: 'Endpoints start from /cs3099group-be-4/'
+ important: 'Endpoints start from /cs3099group-be-4'
});
});
this.express.use('/cs3099group-be-4', FileRouter);
@@ -123,7 +129,7 @@ class App {
.json({
status: 'error',
error : 'invalid_route',
- error_description: 'Endpoints start from /cs3099group-be-4/'
+ error_description: 'Endpoints start from /cs3099group-be-4'
});
} else {
next();