<commit_before>'use strict';

const storageManager = require('./../StorageManager'),
    N = require('./../model/HttpHeaderNames'),
    LeaseStatus = require('./../Constants').LeaseStatus;

class GetBlobProperties {
    constructor() {
    }

    process(request, res) {
        storageManager.getBlobProperties(request)
            .then((response) => {
                response.addHttpProperty(N.ACCEPT_RANGES, 'bytes');
                response.addHttpProperty(N.REQUEST_SERVER_ENCRYPTED, false);
                response.addHttpProperty(N.LEASE_STATUS, ([LeaseStatus.AVAILABLE, LeaseStatus.BROKEN, LeaseStatus.EXPIRED].includes(response.proxy.original.leaseState)) ? 'unlocked' : 'locked');
                response.addHttpProperty(N.LEASE_STATE, response.proxy.original.leaseState);
                if (response.httpProps[N.LEASE_STATE] === LeaseStatus.LEASED) {
                    response.addHttpProperty(N.LEASE_DURATION, (response.proxy.original.leaseDuration === -1) ? 'infinite' : 'fixed');
                }
                response.addHttpProperty(N.CONTENT_TYPE, response.proxy.original.contentType);
                response.addHttpProperty(N.CONTENT_MD5, response.proxy.original.md5);
                response.addHttpProperty(N.CONTENT_LANGUAGE, response.proxy.original.contentLanguage);
                response.addHttpProperty(N.CONTENT_ENCODING, response.proxy.original.contentEncoding);
                response.addHttpProperty(N.CONTENT_DISPOSITION, response.proxy.original.contentDisposition);
                response.addHttpProperty(N.CACHE_CONTROL, response.proxy.original.cacheControl);
                response.addHttpProperty(N.BLOB_TYPE, response.proxy.original.entityType);
                res.set(response.httpProps);
                res.status(200).send();
            });
    }
}

module.exports = new GetBlobProperties();<commit_msg>fixes<commit_after>'use strict';

const storageManager = require('./../StorageManager'),
    N = require('./../model/HttpHeaderNames'),
    LeaseStatus = require('./../Constants').LeaseStatus;

class GetBlobProperties {
    constructor() {
    }

    process(request, res) {
        storageManager.getBlobProperties(request)
            .then((response) => {
                response.addHttpProperty(N.ACCEPT_RANGES, 'bytes');
                response.addHttpProperty(N.REQUEST_SERVER_ENCRYPTED, false);
                response.addHttpProperty(N.LEASE_STATUS, ([LeaseStatus.AVAILABLE, LeaseStatus.BROKEN, LeaseStatus.EXPIRED].includes(response.proxy.original.leaseState)) ? 'unlocked' : 'locked');
                response.addHttpProperty(N.LEASE_STATE, response.proxy.original.leaseState);
                if (response.httpProps[N.LEASE_STATE] === LeaseStatus.LEASED) {
                    response.addHttpProperty(N.LEASE_DURATION, (response.proxy.original.leaseDuration === -1) ? 'infinite' : 'fixed');
                }
                response.addHttpProperty(N.CONTENT_TYPE, response.proxy.original.contentType);
                response.addHttpProperty(N.CONTENT_MD5, response.proxy.original.md5);
                response.addHttpProperty(N.CONTENT_LANGUAGE, response.proxy.original.contentLanguage);
                response.addHttpProperty(N.CONTENT_ENCODING, response.proxy.original.contentEncoding);
                response.addHttpProperty(N.CONTENT_DISPOSITION, response.proxy.original.contentDisposition);
                response.addHttpProperty(N.CACHE_CONTROL, response.proxy.original.cacheControl);
                response.addHttpProperty(N.BLOB_TYPE, response.proxy.original.entityType);
                response.addHttpProperty(N.CONTENT_LENGTH, response.proxy.original.size);
                res.set(response.httpProps);
                res.status(200).send();
            });
    }
}

module.exports = new GetBlobProperties();
{'fraction_non_alphanumeric': 0.12179151388161341, 'fraction_numerical': 0.003143006809848088, 'mean_word_length': 2.8732251521298173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6322682', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1016, 'n_words': 111}