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

Trailing slash on API URLs is very, very confusing

オープン
#200 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
api, backend

調査の方向性

/api/patches/$NUMBER と /api/patches/$NUMBER/ に対する POST および PATCH リクエストを再現することから始めます。リダイレクトレスポンス、メソッド、結果として得られる patch の状態を比較します。個別オブジェクトの URL に対する API の動作が一貫しており、文書化または修正され、更新が暗黙的に no-op にならない状態になれば完了です。

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

説明

enhancement help wanted

@stewart-ibm was complaining that his script to update patch states via the REST API wasn't working.

His script was POSTing the update to "/api/patches/$NUMBER", and receiving an HTTP 200 in response, but no update.

I did some digging and discovered that when you access "/api/patches/$NUMBER", you get back a 301 Moved Permanently to "/api/patches/$NUMBER/" (note trailing slash). It seems that when you do a POST and get a 301 in response, the behaviour is to try a GET on the redirected URL, rather than a POST.

Once I figured this out, I tried doing a POST on the correct URL with the trailing slash, got a 405 Method Not Allowed, and quickly realised the real problem was that we should have been doing a PATCH.

For good measure, I checked what happens when you send a PATCH without the trailing slash, you get a 301, my logs seem to indicate that the subsequent request to the 301 target URL is still a PATCH, yet for some reason the state doesn't update. Not sure why.

Anyway, the trailing slash thing is really confusing and I'm not sure if it's semantically appropriate for accessing an individual object.

Thoughts?

主要言語
Python
スター
317
フォーク
91
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

getpatchwork/patchwork のほかの issue

getpatchwork/patchwork の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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