0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Removed unused internal request lib

refs 3f0bab4389

- the internal `request` lib we had was replaced with `@tryghost/request` in
  the referenced commit
- this lib was not deleted, so it's still lingering around
- this commit deletes that file to clean it up
This commit is contained in:
Daniel Lockyer 2021-08-26 14:21:27 +02:00
parent c7a7828b57
commit 51d602d5b3
No known key found for this signature in database
GPG key ID: D21186F0B47295AD

View file

@ -1,25 +0,0 @@
const got = require('got');
const _ = require('lodash');
const validator = require('@tryghost/validator');
const errors = require('@tryghost/errors');
const ghostVersion = require('@tryghost/version');
const defaultOptions = {
headers: {
'user-agent': 'Ghost/' + ghostVersion.original + ' (https://github.com/TryGhost/Ghost)'
}
};
module.exports = function request(url, options) {
if (_.isEmpty(url) || !validator.isURL(url)) {
return Promise.reject(new errors.InternalServerError({
message: 'URL empty or invalid.',
code: 'URL_MISSING_INVALID',
context: url
}));
}
const mergedOptions = _.merge({}, defaultOptions, options);
return got(url, mergedOptions);
};