发布日期: 2023-02-21
版本号: v1.9.0

本次更新包含以下主要变更:修复了在上下文和渲染过程中不必要的panic问题;解决了路由树循环索引未递减、NegotiateFormat索引越界引发的panic以及头部转义逻辑缺失等缺陷;修复了GO-2022-0969、GO-2022-0288和GO-2023-1571安全漏洞。新增Sonic JSON支持、自动创建指定目录、优化接口检查方式,移除了已弃用的io/ioutil包并优化字符串处理效率。同时修复控制台日志状态码显示问题,升级YAML依赖至v3版本,支持多HTTP方法路由匹配,适配Go 1.20的http.rwUnwrapper。文档方面更新了Markdown格式规范,新增TOML渲染示例并调整示例文档结构。

更新内容 (中文)

更新日志

重大变更

  • 修复上下文和渲染中不必要的 panic 行为 #2150

错误修复

  • 修复(router): 路由树循环索引未递减导致的错误 #3460
  • 修复(context): NegotiateFormat 方法索引越界 panic 问题 #3397
  • 新增请求头转义逻辑 #3500#3503

安全更新

  • 修复 GO-2022-0969 和 GO-2022-0288 安全漏洞 #3333
  • 修复(security): GO-2023-1571 安全漏洞 #3505

功能增强

  • 新增: 支持 sonic JSON 解析 #3184
  • 维护(file): 自动创建指定路径目录 #3316
  • 优化: 改进接口检查方式 #3327
  • 移除已废弃的 io/ioutil 包依赖 #3395
  • 重构: 避免重复调用 strings.ToLower #3343
  • 修复控制台日志 HTTP 状态码显示问题 #3453
  • 升级(yaml): 依赖升级至 v3 版本 #3456
  • 新增(router): 路由组支持多 HTTP 方法匹配 #3464
  • 适配(http): 支持 go1.20 的 http.rwUnwrapper 接口 #3489

文档更新

  • 文档: 优化 Markdown 格式 #3260
  • 文档(readme): 新增 TOML 渲染示例 #3400
  • 文档(readme): 迁移更多示例到 docs/doc.md #3449
  • 文档: 更新 Markdown 格式 #3446

更新内容 (原始)

Changelog

BREAK CHANGES

  • Stop useless panicking in context and render #2150

BUG FIXES

  • fix(router): tree bug where loop index is not decremented. #3460
  • fix(context): panic on NegotiateFormat - index out of range #3397
  • Add escape logic for header #3500 and #3503

SECURITY

  • Fix the GO-2022-0969 and GO-2022-0288 vulnerabilities #3333
  • fix(security): vulnerability GO-2023-1571 #3505

ENHANCEMENTS

  • feat: add sonic json support #3184
  • chore(file): Creates a directory named path #3316
  • fix: modify interface check way #3327
  • remove deprecated of package io/ioutil #3395
  • refactor: avoid calling strings.ToLower twice #3343
  • console logger HTTP status code bug fixed #3453
  • chore(yaml): upgrade dependency to v3 version #3456
  • chore(router): match method added to routergroup for multiple HTTP methods supporting #3464
  • chore(http): add support for go1.20 http.rwUnwrapper to gin.responseWriter #3489

DOCS

  • docs: update markdown format #3260
  • docs(readme): Add the TOML rendering example #3400
  • docs(readme): move more example to docs/doc.md #3449
  • docs: update markdown format #3446

下载链接