Skip to content

Commit

Permalink
Silence morgan's deprecation warning (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live authored Jul 6, 2022
1 parent cd8d1f4 commit c8ec5a8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/appservice/Appservice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,11 @@ export class Appservice extends EventEmitter {
`${req.path}?${stringify(redactObjectForLogging(req.query ?? {}))}`,
);

this.app.use(morgan({
this.app.use(morgan(
// Same as "combined", but with sensitive values removed from requests.
format: ':remote-addr - :remote-user [:date[clf]] ":method :url-safe HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"',
}, {
stream: { write: LogService.info.bind(LogService, 'Appservice') },
}));
':remote-addr - :remote-user [:date[clf]] ":method :url-safe HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"',
{ stream: { write: LogService.info.bind(LogService, 'Appservice') } },
));

// ETag headers break the tests sometimes, and we don't actually need them anyways for
// appservices - none of this should be cached.
Expand Down

0 comments on commit c8ec5a8

Please sign in to comment.