mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
fix: 修复使用代理的情况下申请证书失败的bug
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
const util = require('./util');
|
||||
const { log } = require('./logger');
|
||||
|
||||
/**
|
||||
* AcmeApi
|
||||
@@ -104,6 +105,16 @@ class AcmeApi {
|
||||
/* Set account URL */
|
||||
if (resp.headers.location) {
|
||||
this.accountUrl = resp.headers.location;
|
||||
const mapping = this.http.urlMapping;
|
||||
if (mapping.mappings) {
|
||||
// eslint-disable-next-line guard-for-in,no-restricted-syntax
|
||||
for (const key in mapping.mappings) {
|
||||
const url = mapping.mappings[key];
|
||||
if (this.accountUrl.indexOf(url) > -1) {
|
||||
this.accountUrl = this.accountUrl.replace(url, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resp;
|
||||
|
||||
Reference in New Issue
Block a user