Skip to content

HTTP 的 GET 请求一直返回 403 #949

Description

@1wingedangel

例行检查

  • 我已确认目前没有类似 issue
  • 我已完整查看过项目 README,以及项目文档
  • 我使用了自己的 key,并确认我的 key 是可正常使用的
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

你的版本

  • 公有云版本
  • 私有部署版本

Docker-Compose 部署,版本 4.6.8。

问题描述

我尝试了两种 HTTP 的 GET 请求(Google Custom Search API 和 TMDB的API),在其他软件里可以正常接收到 json 响应,但是在 FastGPT 的高级编排功能中的 HTTP 模块中却返回 403错误 (Request failed with status code 403)。也不知道是哪里有问题。

响应结果以TMDB的API为例:

{
  "error": {
    "message": "Request failed with status code 403",
    "name": "AxiosError",
    "stack": "AxiosError: Request failed with status code 403
     at settle (file:///app/node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/settle.js:19:12)
     at IncomingMessage.handleStreamEnd (file:///app/node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js:589:11)
     at IncomingMessage.emit (node:events:526:35)
     at endReadableNT (node:internal/streams/readable:1359:12)
     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
     at Axios.request (file:///app/node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/Axios.js:45:41)
     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
     at async i (/app/projects/app/.next/server/chunks/91755.js:255:4374)
     at async Object.d [as httpRequest468] (/app/projects/app/.next/server/chunks/91755.js:255:3798)
     at async j (/app/projects/app/.next/server/chunks/91755.js:254:7083)
     at async Promise.all (index 0)
     at async Promise.all (index 0)
     at async Promise.all (index 0)
     at async Promise.all (index 0)
     at async Q (/app/projects/app/.next/server/chunks/91755.js:254:8057)",
    "config": {
      "transitional": {
        "silentJSONParsing": true,
        "forcedJSONParsing": true,
        "clarifyTimeoutError": false
      },
      "adapter": [
        "xhr",
        "http"
      ],
      "transformRequest": [
        null
      ],
      "transformResponse": [
        null
      ],
      "timeout": 0,
      "xsrfCookieName": "XSRF-TOKEN",
      "xsrfHeaderName": "X-XSRF-TOKEN",
      "maxContentLength": -1,
      "maxBodyLength": -1,
      "env": {},
      "headers": {
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": "Bearer  xxxxx",
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "Accept-Encoding": "gzip, deflate, br",
        "Content-Length": "2"
      },
      "method": "get",
      "baseURL": "http://xxxx:3000",
      "url": "https://api.themoviedb.org/3/search/movie",
      "params": {
        "query": "怪物",
        "include_adult": "true",
        "language": "zh-CN"
      },
      "data": "{}"
    },
    "code": "ERR_BAD_REQUEST",
    "status": 403
  }
}

复现步骤

  • HTTP 模块中选择使用 GET 请求
  • 调试应用

预期结果

  • 能够正常获取响应。

相关截图
image
image
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions