<commit_before>'use strict';

angular.module('confRegistrationWebApp')
  .factory('currentRegistrationInterceptor', function ($q, $injector) {
    return {
      'responseError': function (rejection) {
        var regExp = /conferences\/[-a-zA-Z0-9]+\/registrations\/current\/?$/;
        if (rejection.status === 404 && regExp.test(rejection.config.url)) {
          var url = rejection.config.url.split('/');
          if (_.isEmpty(_.last(url))) {
            url.pop();
          }
          url.pop();
          return $injector.get('$http').post(url.join('/'));
        }
        return $q.reject(rejection);
      }
    };
  });<commit_msg>Fix content type bug (415 error from server).  - The server doesn't recognize the POST as type application/json, but adding an empty JSON object {} solves that.<commit_after>'use strict';

angular.module('confRegistrationWebApp')
  .factory('currentRegistrationInterceptor', function ($q, $injector) {
    return {
      'responseError': function (rejection) {
        var regExp = /conferences\/[-a-zA-Z0-9]+\/registrations\/current\/?$/;
        if (rejection.status === 404 && regExp.test(rejection.config.url)) {
          var url = rejection.config.url.split('/');
          if (_.isEmpty(_.last(url))) {
            url.pop();
          }
          url.pop();
          return $injector.get('$http').post(url.join('/'), {});
        }
        return $q.reject(rejection);
      }
    };
  });
{'fraction_non_alphanumeric': 0.17647058823529413, 'fraction_numerical': 0.008996539792387544, 'mean_word_length': 2.4346793349168645, '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': '5040260', 'n_tokens_mistral': 445, 'n_tokens_neox': 429, 'n_words': 82}