src/tiler/http/windshaftServer.js
// set default before/after filters if not set in opts object
set default before/after filters if not set in opts object
set default before / after filters if not set in opts object
function addFilters(app, opts) {
    _.extend(app, opts);
    _.defaults(app, {
        doCORS: function(res, extraHeaders) {
            if (opts.enable_cors) {
                var baseHeaders = 'X-Requested-With, X-Prototype-Version, X-CSRF-Token';
                if(extraHeaders) {
                    baseHeaders += ', ' + extraHeaders;
                }
                res.header('Access-Control-Allow-Origin', '*');
                res.header('Access-Control-Allow-Headers', baseHeaders);
            }
        }
    });
}
function addFilters ( app , opts ) { _ . extend ( app , opts ) ; _ . defaults ( app , { doCORS : function ( res , extraHeaders ) { if ( opts . enable_cors ) { var baseHeaders = 'X-Requested-With, X-Prototype-Version, X-CSRF-Token' ; if ( extraHeaders ) { baseHeaders += ', ' + extraHeaders ; } res . header ( 'Access-Control-Allow-Origin' , '*' ) ; res . header ( 'Access-Control-Allow-Headers' , baseHeaders ) ; } } } ) ; }
set default before/after filters if not set in opts object
set default before / after filters if not set in opts object
// Extend windshaft with all the elements of the options object // filters can be used for custom authentication, caching, logging etc // Enable CORS access by web browsers if set