<commit_before>var restify = require('restify')
var dataUriToBuffer = require('data-uri-to-buffer')
var faceblur = require('faceblur')
var server = restify.createServer()
var port = process.env.PORT || 8000

server.use(restify.acceptParser(server.acceptable))
server.use(restify.bodyParser({
  maxBodySize: 1000000,
  mapParams: false
}))

server.head('/', function(req, res, next) {
  res.send(200)
})

server.post('/service', function(req, res, next) {
  var buffer = dataUriToBuffer(req.body.content.data)

  faceblur(buffer, function(err, blurred) {
    var data = [
      'data:',
      blurred.type,
      ';base64,',
      blurred.toString('base64')
    ].join('')
<commit_msg>Pass through data if not a workable filetype<commit_after>var restify = require('restify')
var dataUriToBuffer = require('data-uri-to-buffer')
var faceblur = require('faceblur')
var server = restify.createServer()
var port = process.env.PORT || 8000

server.use(restify.acceptParser(server.acceptable))
server.use(restify.bodyParser({
  maxBodySize: 1000000,
  mapParams: false
}))

server.head('/', function(req, res, next) {
  res.send(200)
})

server.post('/service', function(req, res, next) {
  var buffer = dataUriToBuffer(req.body.content.data)

  if (['jpeg', 'png', 'gif'].indexOf(buffer.type) === -1) {
    return res.json(req.body)
  }

  faceblur(buffer, function(err, blurred) {
    var data = [
      'data:',
      blurred.type,
      ';base64,',
      blurred.toString('base64')
    ].join('')

{'fraction_non_alphanumeric': 0.16599732262382866, 'fraction_numerical': 0.024765729585006693, 'mean_word_length': 4.264084507042254, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '150345', 'n_tokens_mistral': 546, 'n_tokens_neox': 499, 'n_words': 102}