<commit_before>/**
 * Created by Indexyz on 2017/4/11.
 */
'use strict';

const Router = require('co-router');
let router = Router();

const errors = require("./Errors");

router.get("/", (req, res, next) => {
    res.send({
        meta: {
            serverName: "Identity service",
            implementationName: "Identity",
            implementationVersion: "0.0.0"
        },
        skinDomains: [
            req.get("host")
        ]
    })
});

router.use("/skin", require("./Skin/Urls"));

router.use((req, res, next) => {
    if (req.headers["content-type"] === undefined || req.headers["content-type"].indexOf("application/json") === -1){
        return errors.makeError(res, errors.UnsupportedMediaType);
    } else {
        next();
    }
});

router.use("/authserver", require('./AuthServer/Urls'));
router.use("/sessionserver", require("./SessionServer/Urls"));
router.use("/api", require("./API/Urls"));

module.exports = router;<commit_msg>[Fix] API: Only show content-type error in /authserver<commit_after>/**
 * Created by Indexyz on 2017/4/11.
 */
'use strict';

const Router = require('co-router');
let router = Router();

const errors = require("./Errors");

router.get("/", (req, res, next) => {
    res.send({
        meta: {
            serverName: "Identity service",
            implementationName: "Identity",
            implementationVersion: "0.0.0"
        },
        skinDomains: [
            req.get("host")
        ]
    })
});

router.use("/skin", require("./Skin/Urls"));

router.use("/authserver", (req, res, next) => {
    if (req.headers["content-type"] === undefined || req.headers["content-type"].indexOf("application/json") === -1){
        return errors.makeError(res, errors.UnsupportedMediaType);
    } else {
        next();
    }
});

router.use("/authserver", require('./AuthServer/Urls'));
router.use("/sessionserver", require("./SessionServer/Urls"));
router.use("/api", require("./API/Urls"));

module.exports = router;
{'fraction_non_alphanumeric': 0.20394736842105263, 'fraction_numerical': 0.011133603238866396, 'mean_word_length': 2.9071146245059287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '304860', 'n_tokens_mistral': 615, 'n_tokens_neox': 604, 'n_words': 117}