Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#2,920 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@takagibit18 がすでに取り組んでいます。

2026年10月2日 から。

  • #2923 @takagibit18 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
api

調査の方向性

packages/core-internal/src/shared/uriTemplate.ts から始め、提供された repro.mjs を Node.js 24 以降で実行します。予約展開とフラグメント展開で、既存の有効な %HH シーケンスを保持しつつ、それ以外のパーセント記号はエンコードするように UriTemplate.expand() を更新します。repro は期待される 2 つの出力を生成するはずです。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
13.5k
フォーク
2.3k
平均マージ
1日 15時間
マージ済み PR(30日)
51

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/typescript-sdk のほかの issue

modelcontextprotocol/typescript-sdk の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。