V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ydong
V2EX  ›  GitHub

使用 Github Action 执行 nodejs 任务 axios 报错

  •  
  •   ydong · 177 天前 · 384 次点击
    这是一个创建于 177 天前的主题,其中的信息可能已经有所发展或是发生改变。

    想用 GitHub action 执行一个定时签到的任务,用 nodejs 写的,请求库用的 axios ,在本地跑没有问题,让 action 跑流水线总是 axios 报错,求有经验的大佬来看看 刚开始报错AxiosError.call(axiosError, error.message, code, config, request, response); ^ AxiosError: Parse Error: Invalid header value char Google 搜索后说是请求头加上insecureHTTPParser: true,加上之后报错变成了 reject(new AxiosError( ^ AxiosError: Request failed with status code 403

    4 条回复    2023-11-02 18:27:53 +08:00
    zsj1029
        1
    zsj1029  
       177 天前
    没有环境,试试 node-fetch ?
    grit136907108
        2
    grit136907108  
       177 天前
    看看 node 、axios 的版本对不对
    hronro
        3
    hronro  
       177 天前
    第一个问题是因为 TLS 证书有问题,第二个问题大概率是 IP 被风控了
    ydong
        4
    ydong  
    OP
       177 天前
    @hronro 应该是 IP 的问题,现在可以了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2798 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 15:17 · PVG 23:17 · LAX 08:17 · JFK 11:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.