fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartwhois',
|
||||
version: '1.0.8',
|
||||
version: '1.0.9',
|
||||
description: 'a package for dealing with whois requests'
|
||||
}
|
||||
|
21
ts/index.ts
21
ts/index.ts
@ -53,6 +53,27 @@ export class SmartWhois {
|
||||
}
|
||||
}
|
||||
|
||||
public async getAdditionalWhoisDataForDomain(domainArg: string) {
|
||||
if (domainArg.includes('//')) {
|
||||
const parsedUrlResult = await this.getParsedUrlResultForWhois(domainArg);
|
||||
domainArg = parsedUrlResult.fullDomain;
|
||||
}
|
||||
|
||||
// lets test http response
|
||||
const httpResult = await plugins.smartrequest.safeGet(`http://${domainArg}/`);
|
||||
|
||||
// lets test https response
|
||||
const httpsResult = await plugins.smartrequest.safeGet(`https://${domainArg}/`);
|
||||
|
||||
return {
|
||||
httpStatus: httpResult.statusCode,
|
||||
httpsStatus: httpsResult.statusCode,
|
||||
httpContentType: httpResult.headers['content-type'],
|
||||
httpsContentType: httpsResult.headers['content-type'],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async getWhoisForDomain(domainArg: string): Promise<IWhoisInfo> {
|
||||
if (domainArg.includes('//')) {
|
||||
|
@ -1,8 +1,10 @@
|
||||
// pushrocks scope
|
||||
import * as smarturl from '@pushrocks/smarturl';
|
||||
import * as smartrequest from '@pushrocks/smartrequest';
|
||||
|
||||
export {
|
||||
smarturl,
|
||||
smartrequest,
|
||||
}
|
||||
|
||||
// third party
|
||||
|
Reference in New Issue
Block a user