Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Tool, service and variable get requests omit configured headers

未关闭 适合新手
#122 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
api, backend

调研方向

从 ToolServiceVariableBaseQuery.get 开始,将其请求循环与 Query.get、Query.results 和 Query.hits 进行比较。使用 Requests 的 send 拦截来验证 ToolQuery、ServiceQuery 和 VariableQuery 中配置的请求头,包括分页和空结果。完成的标准是聚焦的离线用例通过,同时分页、输出格式和 HTTP 错误传播保持不变。

由索引模型根据 Issue 内容生成。

描述

Problem

On develop at 9f7648ccb925b9c0eb50241e35f15d6454e89505, ToolServiceVariableBaseQuery.get omits the configured request headers. The shared implementation affects ToolQuery, ServiceQuery and VariableQuery.

Setting headers through either supported token method, or directly through the public headers mapping, works for the base Query methods but has no effect on the specialized get requests. The request loop supplies only its URL and pagination parameters.

Reproduction

Create any of the three query classes, configure a header, and call get with Requests' send method intercepted. The prepared request does not contain the configured header. This reproduces on every page. No live request is needed.

Expected behavior

Forward the query's headers on every get request, consistent with Query.get, Query.results and Query.hits. Preserve current pagination, output-format handling, empty results and HTTP error propagation.

A focused production fix and 18 offline test cases are prepared. Twelve fail on the original implementation and six controls pass. The complete 147-test suite passes with the fix using the repository-locked HTTP/VCR versions, as do mypy and the repository's gating lint checks. No real credentials or live CMR calls are used.

主要语言
Python
星标
29
派生
32
PR 合并指标
30 天内没有已合并 PR

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nasa/python_cmr 的其他 Issue

查看 nasa/python_cmr 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。