fix: code scanning alerts (#2750)

This commit is contained in:
Tom Moor
2021-11-08 22:46:30 -08:00
committed by GitHub
parent 87e8ef8fe6
commit 6a64dfe4b2
5 changed files with 8 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ export default function present(
// the context contains <b> tags around search terms, we convert them here
// to the markdown format that slack expects to receive.
const text = context
? context.replace(/<\/?b>/g, "*").replace("\n", "")
? context.replace(/<\/?b>/g, "*").replace(/\n/g, "")
: document.getSummary();
return {

View File

@@ -5,5 +5,7 @@ const DISALLOW_ROBOTS = `User-agent: *
Disallow: /`;
export const robotsResponse = (ctx: Context): ?string => {
if (ctx.headers.host.indexOf("getoutline.com") < 0) return DISALLOW_ROBOTS;
if (process.env.DEPLOYMENT !== "hosted") {
return DISALLOW_ROBOTS;
}
};