<commit_before>const busboy = require('connect-busboy');
const helmet = require('helmet');
const bodyParser = require('body-parser');
const requestLanguage = require('express-request-language');
const languages = require('../languages');
const storage = require('../storage');
const config = require('../config');
const pages = require('./pages');
// const lang = require('fluent-langneg')

module.exports = function(app) {
  app.use(
    requestLanguage({
      languages
    })
  );
  app.use(helmet());
  app.use(
    helmet.hsts({
      maxAge: 31536000,
      force: config.env === 'production'
    })
  );
  app.use(
    helmet.contentSecurityPolicy({
      directives: {
        defaultSrc: ["'self'"],
        connectSrc: [
          "'self'",
          'https://sentry.prod.mozaws.net',
          'https://www.google-analytics.com'
        ],
        imgSrc: ["'self'", 'https://www.google-analytics.com'],
        scriptSrc: ["'self'"],
        styleSrc: ["'self'", 'https://code.cdn.mozilla.net'],
        fontSrc: ["'self'", 'https://code.cdn.mozilla.net'],
        formAction: ["'none'"],
        frameAncestors: ["'none'"],
        objectSrc: ["'none'"],
        reportUri: '/__cspreport__'
      }
    })
  );
  app.use(
    busboy({<commit_msg>disable CSP when env = development<commit_after>const busboy = require('connect-busboy');
const helmet = require('helmet');
const bodyParser = require('body-parser');
const requestLanguage = require('express-request-language');
const languages = require('../languages');
const storage = require('../storage');
const config = require('../config');
const pages = require('./pages');
// const lang = require('fluent-langneg')
const IS_DEV = config.env === 'development';

module.exports = function(app) {
  app.use(
    requestLanguage({
      languages
    })
  );
  app.use(helmet());
  app.use(
    helmet.hsts({
      maxAge: 31536000,
      force: !IS_DEV
    })
  );
  if (!IS_DEV) {
    app.use(
      helmet.contentSecurityPolicy({
        directives: {
          defaultSrc: ["'self'"],
          connectSrc: [
            "'self'",
            'https://sentry.prod.mozaws.net',
            'https://www.google-analytics.com'
          ],
          imgSrc: ["'self'", 'https://www.google-analytics.com'],
          scriptSrc: ["'self'"],
          styleSrc: ["'self'", 'https://code.cdn.mozilla.net'],
          fontSrc: ["'self'", 'https://code.cdn.mozilla.net'],
          formAction: ["'none'"],
          frameAncestors: ["'none'"],
          objectSrc: ["'none'"],
          reportUri: '/__cspreport__'
        }
      })
    );
  }
  app.use(
    busboy({
{'fraction_non_alphanumeric': 0.1922344880091359, 'fraction_numerical': 0.006090597639893415, 'mean_word_length': 2.5803814713896456, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '623877', 'n_tokens_mistral': 830, 'n_tokens_neox': 820, 'n_words': 148}