【发布时间】:2022-04-07 04:30:55
【问题描述】:
我正在创建一个工具,该工具将使用以下 http 请求为某个 shopify 商店创建帐户:
await axios.post(
siteURL + "/account",
qs.stringify({
"form_type": "create_customer",
"customer[first_name]": firstName,
"customer[last_name]": lastName,
"customer[email]": email,
"customer[password]": password,
}),
{
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36"
}
}
);
现在,此请求非常适用于 https://kith.com 或 https://packershoes.com 之类的网站,但对于 https://neighborhood.jp 或 https://windandsea.jp/ 之类的网站,此请求会引发以下 404 错误:
ClientRequest {
_events: [Object: null prototype] {
socket: [Function],
abort: [Function],
aborted: [Function],
error: [Function],
timeout: [Function],
prefinish: [Function: requestOnPrefinish]
},
_eventsCount: 6,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: 0,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: TLSSocket {
_tlsOptions: {
allowHalfOpen: undefined,
pipe: false,
secureContext: [SecureContext],
isServer: false,
requestCert: true,
rejectUnauthorized: true,
session: <Buffer 30 82 06 da 02 01 01 02 02 03 04 04 02 13 02 04 20 fa 3e 8f ba c6 59 fb 94 86 e3 68 63 3f 43 fd 86 10 11 07 97 d7 10 1e d2
99 55 b6 36 f3 e2 3d a1 04 ... 1708 more bytes>,
ALPNProtocols: undefined,
requestOCSP: undefined,
enableTrace: undefined,
pskCallback: undefined
},
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'www.neighborhood.jp',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype] {
close: [Array],
end: [Function: onReadableStreamEnd],
newListener: [Function: keylogNewListener],
secure: [Function: onConnectSecure],
session: [Function],
free: [Function: onFree],
agentRemove: [Function: onRemove],
error: [Function: socketErrorListener],
finish: [Function]
},
_eventsCount: 9,
connecting: false,
_hadError: false,
_parent: null,
_host: 'www.neighborhood.jp',
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: false,
endEmitted: false,
reading: true,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
emitClose: false,
autoDestroy: false,
destroyed: false,
defaultEncoding: 'utf8',
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null,
[Symbol(kPaused)]: false
},
readable: true,
_maxListeners: undefined,
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: true,
needDrain: false,
ending: true,
ended: true,
finished: false,
destroyed: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: false,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 1,
prefinished: false,
errorEmitted: false,
emitClose: false,
autoDestroy: false,
bufferedRequestCount: 0,
corkedRequestsFree: [Object]
},
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: TLSWrap {
_parent: [TCP],
_parentWrap: undefined,
_secureContext: [SecureContext],
reading: true,
onhandshakestart: [Function: noop],
onhandshakedone: [Function],
onocspresponse: [Function: onocspresponse],
onnewsession: [Function: onnewsessionclient],
onkeylog: [Function: onkeylogclient],
onerror: [Function: onerror],
[Symbol(owner)]: [Circular]
},
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: TLSWrap {
_parent: [TCP],
_parentWrap: undefined,
_secureContext: [SecureContext],
reading: true,
onhandshakestart: [Function: noop],
onhandshakedone: [Function],
onocspresponse: [Function: onocspresponse],
onnewsession: [Function: onnewsessionclient],
onkeylog: [Function: onkeylogclient],
onerror: [Function: onerror],
[Symbol(owner)]: [Circular]
},
[Symbol(asyncId)]: 205,
[Symbol(kHandle)]: TLSWrap {
_parent: [TCP],
_parentWrap: undefined,
_secureContext: [SecureContext],
reading: true,
onhandshakestart: [Function: noop],
onhandshakedone: [Function],
onocspresponse: [Function: onocspresponse],
onnewsession: [Function: onnewsessionclient],
onkeylog: [Function: onkeylogclient],
onerror: [Function: onerror],
[Symbol(owner)]: [Circular]
},
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: {
rejectUnauthorized: true,
ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
checkServerIdentity: [Function: checkServerIdentity],
minDHSize: 1024,
session: <Buffer 30 82 06 da 02 01 01 02 02 03 04 04 02 13 02 04 20 fa 3e 8f ba c6 59 fb 94 86 e3 68 63 3f 43 fd 86 10 11 07 97 d7 10 1e d2
99 55 b6 36 f3 e2 3d a1 04 ... 1708 more bytes>,
protocol: 'https:',
maxRedirects: 21,
maxBodyLength: 10485760,
path: null,
method: 'GET',
headers: [Object],
agent: undefined,
agents: [Object],
auth: null,
hostname: 'www.neighborhood.jp',
port: 443,
nativeProtocols: [Object],
pathname: '/challenge',
slashes: true,
host: 'www.neighborhood.jp',
hash: null,
search: null,
query: null,
href: 'https://www.neighborhood.jp/challenge',
_defaultAgent: [Agent],
servername: 'www.neighborhood.jp',
_agentKey: 'www.neighborhood.jp:443::::::::::::::::::',
encoding: null,
singleUse: true
}
},
connection: TLSSocket {
_tlsOptions: {
allowHalfOpen: undefined,
pipe: false,
secureContext: [SecureContext],
isServer: false,
requestCert: true,
rejectUnauthorized: true,
session: <Buffer 30 82 06 da 02 01 01 02 02 03 04 04 02 13 02 04 20 fa 3e 8f ba c6 59 fb 94 86 e3 68 63 3f 43 fd 86 10 11 07 97 d7 10 1e d2
99 55 b6 36 f3 e2 3d a1 04 ... 1708 more bytes>,
ALPNProtocols: undefined,
requestOCSP: undefined,
enableTrace: undefined,
pskCallback: undefined
},
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'www.neighborhood.jp',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype] {
close: [Array],
end: [Function: onReadableStreamEnd],
newListener: [Function: keylogNewListener],
secure: [Function: onConnectSecure],
session: [Function],
free: [Function: onFree],
agentRemove: [Function: onRemove],
error: [Function: socketErrorListener],
finish: [Function]
},
_eventsCount: 9,
connecting: false,
_hadError: false,
_parent: null,
_host: 'www.neighborhood.jp',
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: false,
endEmitted: false,
reading: true,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
emitClose: false,
autoDestroy: false,
destroyed: false,
defaultEncoding: 'utf8',
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null,
[Symbol(kPaused)]: false
},
readable: true,
_maxListeners: undefined,
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: true,
needDrain: false,
ending: true,
ended: true,
finished: false,
destroyed: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: false,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 1,
prefinished: false,
errorEmitted: false,
emitClose: false,
autoDestroy: false,
bufferedRequestCount: 0,
corkedRequestsFree: [Object]
},
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: TLSWrap {
_parent: [TCP],
_parentWrap: undefined,
_secureContext: [SecureContext],
reading: true,
onhandshakestart: [Function: noop],
onhandshakedone: [Function],
onocspresponse: [Function: onocspresponse],
onnewsession: [Function: onnewsessionclient],
onkeylog: [Function: onkeylogclient],
onerror: [Function: onerror],
[Symbol(owner)]: [Circular]
},
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: TLSWrap {
_parent: [TCP],
_parentWrap: undefined,
_secureContext: [SecureContext],
reading: true,
onhandshakestart: [Function: noop],
onhandshakedone: [Function],
onocspresponse: [Function: onocspresponse],
onnewsession: [Function: onnewsessionclient],
onkeylog: [Function: onkeylogclient],
onerror: [Function: onerror],
[Symbol(owner)]: [Circular]
},
[Symbol(asyncId)]: 205,
[Symbol(kHandle)]: TLSWrap {
_parent: [TCP],
_parentWrap: undefined,
_secureContext: [SecureContext],
reading: true,
onhandshakestart: [Function: noop],
onhandshakedone: [Function],
onocspresponse: [Function: onocspresponse],
onnewsession: [Function: onnewsessionclient],
onkeylog: [Function: onkeylogclient],
onerror: [Function: onerror],
[Symbol(owner)]: [Circular]
},
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: {
rejectUnauthorized: true,
ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
checkServerIdentity: [Function: checkServerIdentity],
minDHSize: 1024,
session: <Buffer 30 82 06 da 02 01 01 02 02 03 04 04 02 13 02 04 20 fa 3e 8f ba c6 59 fb 94 86 e3 68 63 3f 43 fd 86 10 11 07 97 d7 10 1e d2
99 55 b6 36 f3 e2 3d a1 04 ... 1708 more bytes>,
protocol: 'https:',
maxRedirects: 21,
maxBodyLength: 10485760,
path: null,
method: 'GET',
headers: [Object],
agent: undefined,
agents: [Object],
auth: null,
hostname: 'www.neighborhood.jp',
port: 443,
nativeProtocols: [Object],
pathname: '/challenge',
slashes: true,
host: 'www.neighborhood.jp',
hash: null,
search: null,
query: null,
href: 'https://www.neighborhood.jp/challenge',
_defaultAgent: [Agent],
servername: 'www.neighborhood.jp',
_agentKey: 'www.neighborhood.jp:443::::::::::::::::::',
encoding: null,
singleUse: true
}
},
_header: 'GET /challenge HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36\r\n' +
'Host: www.neighborhood.jp\r\n' +
'Connection: close\r\n' +
'\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: Agent {
_events: [Object: null prototype] {
free: [Function],
newListener: [Function: maybeEnableKeylog]
},
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: { path: null },
requests: {},
sockets: { 'www.neighborhood.jp:443::::::::::::::::::': [Array] },
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
maxCachedSessions: 100,
_sessionCache: { map: [Object], list: [Array] },
[Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'GET',
insecureHTTPParser: undefined,
path: '/challenge',
_ended: true,
res: IncomingMessage {
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: true,
endEmitted: true,
reading: false,
sync: false,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
emitClose: true,
autoDestroy: false,
destroyed: false,
defaultEncoding: 'utf8',
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null,
[Symbol(kPaused)]: false
},
readable: false,
_events: [Object: null prototype] {
end: [Array],
data: [Function: handleStreamData],
error: [Function: handleStreamError]
},
_eventsCount: 3,
_maxListeners: undefined,
socket: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'www.neighborhood.jp',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 9,
connecting: false,
_hadError: false,
_parent: null,
_host: 'www.neighborhood.jp',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 205,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object]
},
connection: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'www.neighborhood.jp',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 9,
connecting: false,
_hadError: false,
_parent: null,
_host: 'www.neighborhood.jp',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 205,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object]
},
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: {
date: 'Thu, 04 Jun 2020 05:44:00 GMT',
'content-type': 'text/html; charset=utf-8',
'transfer-encoding': 'chunked',
connection: 'close',
'set-cookie': [Array],
'x-sorting-hat-podid': '76',
'x-sorting-hat-shopid': '22297968717',
'x-frame-options': 'DENY',
'x-shopid': '22297968717',
'x-shardid': '76',
'content-language': 'ja',
'x-shopify-generated-cart-token': 'ec01373dbd31b4829ecfb3d179924f78',
'strict-transport-security': 'max-age=7889238',
'x-alternate-cache-key': 'cacheable:57d4938b6eec0948258100bed68b0d2d',
'x-cache': 'miss',
'x-shopify-stage': 'production',
'content-security-policy': "block-all-mixed-content; frame-ancestors 'none'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=challenge&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=storefront_section%2Fcaptcha_throttle&source%5Bsection%5D=storefront&source%5Buuid%5D=253b7e9b-919d-49b2-b508-865869943bbe",
'x-content-type-options': 'nosniff',
'x-download-options': 'noopen',
'x-permitted-cross-domain-policies': 'none',
'x-xss-protection': '1; mode=block; report=/xss-report?source%5Baction%5D=challenge&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=storefront_section%2Fcaptcha_throttle&source%5Bsection%5D=storefront&source%5Buuid%5D=253b7e9b-919d-49b2-b508-865869943bbe',
'x-dc': 'gcp-us-central1,gcp-us-east1,gcp-us-east1',
'x-request-id': '253b7e9b-919d-49b2-b508-865869943bbe',
'cf-cache-status': 'DYNAMIC',
'cf-request-id': '031f74a5e20000bcc658ae1200000001',
'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
server: 'cloudflare',
'cf-ray': '59df56e96822bcc6-SEA',
'alt-svc': 'h3-27=":443"; ma=86400'
},
rawHeaders: [
'Date',
'Thu, 04 Jun 2020 05:44:00 GMT',
'Content-Type',
'text/html; charset=utf-8',
'Transfer-Encoding',
'chunked',
'Connection',
'close',
'Set-Cookie',
'__cfduid=db595ddcb05d8c2398f57eb5b22bc62fb1591249440; expires=Sat, 04-Jul-20 05:44:00 GMT; path=/; domain=.www.neighborhood.jp; HttpOnly; SameSite=Lax',
'X-Sorting-Hat-PodId',
'76',
'X-Sorting-Hat-ShopId',
'22297968717',
'X-Frame-Options',
'DENY',
'X-ShopId',
'22297968717',
'X-ShardId',
'76',
'Content-Language',
'ja',
'X-Shopify-Generated-Cart-Token',
'ec01373dbd31b4829ecfb3d179924f78',
'Strict-Transport-Security',
'max-age=7889238',
'X-Alternate-Cache-Key',
'cacheable:57d4938b6eec0948258100bed68b0d2d',
'X-Cache',
'miss',
'Set-Cookie',
'secure_customer_sig=; path=/; expires=Mon, 04 Jun 2040 05:44:00 GMT; secure; HttpOnly',
'X-Shopify-Stage',
'production',
'Content-Security-Policy',
"block-all-mixed-content; frame-ancestors 'none'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=challenge&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=storefront_section%2Fcaptcha_throttle&source%5Bsection%5D=storefront&source%5Buuid%5D=253b7e9b-919d-49b2-b508-865869943bbe",
'X-Content-Type-Options',
'nosniff',
'X-Download-Options',
'noopen',
'X-Permitted-Cross-Domain-Policies',
'none',
'X-XSS-Protection',
'1; mode=block; report=/xss-report?source%5Baction%5D=challenge&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=storefront_section%2Fcaptcha_throttle&source%5Bsection%5D=storefront&source%5Buuid%5D=253b7e9b-919d-49b2-b508-865869943bbe',
'X-Dc',
'gcp-us-central1,gcp-us-east1,gcp-us-east1',
'X-Request-ID',
'253b7e9b-919d-49b2-b508-865869943bbe',
'Set-Cookie',
'cart_currency=JPY; path=/; expires=Thu, 18 Jun 2020 05:44:00 GMT',
'Set-Cookie',
'_shopify_country=United+States; path=/',
'Set-Cookie',
'cart_sig=; path=/; expires=Thu, 18 Jun 2020 05:44:00 GMT; HttpOnly',
'CF-Cache-Status',
'DYNAMIC',
'cf-request-id',
'031f74a5e20000bcc658ae1200000001',
'Expect-CT',
'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
'Server',
'cloudflare',
'CF-RAY',
'59df56e96822bcc6-SEA',
'alt-svc',
'h3-27=":443"; ma=86400'
],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 404,
statusMessage: 'Not Found',
client: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'www.neighborhood.jp',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 9,
connecting: false,
_hadError: false,
_parent: null,
_host: 'www.neighborhood.jp',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 205,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object]
},
_consuming: true,
_dumped: false,
req: [Circular],
responseUrl: 'https://www.neighborhood.jp/challenge',
redirects: [],
[Symbol(kCapture)]: false
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
_redirectable: Writable {
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
emitClose: true,
autoDestroy: false,
bufferedRequestCount: 0,
corkedRequestsFree: [Object]
},
writable: true,
_events: [Object: null prototype] {
response: [Function: handleResponse],
error: [Function: handleRequestError]
},
_eventsCount: 2,
_maxListeners: undefined,
_options: {
protocol: 'https:',
maxRedirects: 21,
maxBodyLength: 10485760,
path: '/challenge',
method: 'GET',
headers: [Object],
agent: undefined,
agents: [Object],
auth: null,
hostname: 'www.neighborhood.jp',
port: null,
nativeProtocols: [Object],
pathname: '/challenge',
slashes: true,
host: 'www.neighborhood.jp',
hash: null,
search: null,
query: null,
href: 'https://www.neighborhood.jp/challenge'
},
_redirectCount: 1,
_redirects: [],
_requestBodyLength: 167,
_requestBodyBuffers: [],
_onNativeResponse: [Function],
_currentRequest: [Circular],
_currentUrl: 'https://www.neighborhood.jp/challenge',
_isRedirect: true,
[Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
accept: [ 'Accept', 'application/json, text/plain, */*' ],
'user-agent': [
'User-Agent',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36'
],
host: [ 'Host', 'www.neighborhood.jp' ]
}
}
有人可以尝试向我解释这里到底发生了什么以及可能的解决方案吗?
感谢所有帮助:)
【问题讨论】:
-
您无法禁用或绕过挑战。当您在注册/联系表单上从同一 IP 发出两个请求时,这是 Shopify 的强制要求。挑战是指多次提交尝试后显示的谷歌recaptcha。
-
@drip 感谢您的回复。你知道如何绕过验证码吗?还是制作IP?感谢您的帮助!
-
你不能,这是 Shopify 的强制垃圾邮件保护表单,它不能被覆盖或绕过。如果您能够使用代理来屏蔽服务器,您可能能够绕过它,但这有点过头了。
标签: javascript http axios shopify recaptcha