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:
parent
c7a7828b57
commit
51d602d5b3
1 changed files with 0 additions and 25 deletions
|
@ -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);
|
||||
};
|
Loading…
Add table
Reference in a new issue