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 strict expansions leave !'()* unencoded

Đang mở Phù hợp với người mới
#2,919 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.

  • #2922 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, tập trung vào UriTemplate.expand() và encodeValue(), sau đó chạy ví dụ repro.mjs bằng Node.js 24 trở lên. Hoàn thành có nghĩa là các phép mở rộng simple và query mã hóa phần trăm !'()* như minh họa, trong khi các phép mở rộng reserved và fragment giữ lại các ký tự được phép của chúng.

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() leaves !'()* unchanged in simple expansions. Query values have the same problem: search{?q} with q: 'hello!' produces search?q=hello!.

encodeURIComponent() leaves these characters unchanged, and encodeValue() returns that output directly for strict expansion operators.

What did you expect?

Expected output from the snippet below:

%21%27%28%29%2A
search?q=hello%21

RFC 6570 section 3.2.1 permits unreserved characters in strict variable expansions. The five characters above are reserved and need percent-encoding. Reserved and fragment expansions can keep them.

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';

const value = "!'()*";
console.log(new UriTemplate('{value}').expand({ value }));
console.log(new UriTemplate('search{?q}').expand({ q: 'hello!' }));

Current output:

!'()*
search?q=hello!
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.