workshops-de/google_gax
GitHub: workshops-de/google_gax
google_gax 0.4.1 的修补分支,修复已停止维护的上游库与 Tesla 1.18.3+ multipart 严格校验之间的兼容性问题。
Stars: 0 | Forks: 0
# google_gax (已修补)
这是 [google_gax](https://hex.pm/packages/google_gax) v0.4.1 的修补分支,用于
兼容 Tesla >= 1.18.3。
## 为什么会有这个分支
Tesla 1.18.3(2026 年 6 月 2 日)引入了对 multipart 字段
名称的严格验证(通过 `assert_quoted_string_safe!/2` 实现),作为
CVE-2026-48598 安全修复的一部分。上游的 `google_gax`(最后发布于 2021 年,目前已停止维护)
将 atom(`:metadata`, `:data`)作为 multipart 字段名传递,现在 Tesla 会
抛出 `FunctionClauseError` 拒绝该请求。
## 相对于上游的更改
- `connection.ex`:在传递给 `Tesla.Multipart.add_field/4` 和 `Tesla.Multipart.add_file/3`
之前,将 atom 字段名转换为字符串(`to_string/1`)
- `connection.ex`:为 headers 使用字符串元组(`{"Content-Type", ...}`)
而不是 atom 元组(`{:"Content-Type", ...}`)
- `mix.exs`:放宽了 `mime` 和 `poison` 的版本约束
## 用法
```
# mix.exs
{:google_gax, github: "workshops-de/google_gax", override: true}
```
## 上游
- Hex: https://hex.pm/packages/google_gax
- Source: https://github.com/googleapis/elixir-google-api/tree/master/clients/gax
- Open issue: https://github.com/googleapis/elixir-google-api/issues/12817
标签:API客户端, Elixir, Tesla, 兼容性补丁, 开发库