Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[v2] URI template reserved expansions encode existing %HH sequences again

Đang mở Phù hợp với người mới
#2,920 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@takagibit18 đang làm issue này rồi.

Từ ngày 2/10/2026.

  • #2923 của @takagibit18 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu với packages/core-internal/src/shared/uriTemplate.ts và chạy repro.mjs được cung cấp bằng Node.js 24 trở lên. Cập nhật UriTemplate.expand() để các phép mở rộng reserved và fragment giữ nguyên các chuỗi %HH hợp lệ hiện có, đồng thời vẫn mã hóa các dấu phần trăm khác; repro sẽ tạo ra hai đầu ra như mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

v1 v2
What happened?

UriTemplate.expand() encodes the percent sign in an existing escape during reserved (+) and fragment (#) expansion. A path containing My%20File.txt becomes My%2520File.txt.

What did you expect?

Expected output from the snippet below:

file:///docs/My%20File.txt
docs#Part%20One

RFC 6570 section 3.2.1 allows existing percent-encoded triplets in reserved and fragment values. An ordinary percent sign, or a percent sign without two following hex digits, still needs encoding.

Code to reproduce

Save this as repro.mjs at the SDK repository root and run node repro.mjs with Node.js 24 or later. It imports the source module directly.

import { UriTemplate } from './packages/core-internal/src/shared/uriTemplate.ts';

console.log(new UriTemplate('file://{+path}').expand({ path: '/docs/My%20File.txt' }));
console.log(new UriTemplate('docs{#section}').expand({ section: 'Part%20One' }));

Current output:

file:///docs/My%2520File.txt
docs#Part%2520One
SDK version

main at e16d27729ea2fae144a6d957fd0372d9eb0e6c58 (v2 source checkout). Tested with Node.js 24.12.0.

Area

Other

Ngôn ngữ chính
TypeScript
Star
13.5k
Fork
2.3k
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
54

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của modelcontextprotocol/typescript-sdk

Tất cả issue của modelcontextprotocol/typescript-sdk

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.