Add Plug.Conn.Status.valid?/1
まだ誰も着手していません。
評価
調査の方向性
lib/plug/conn/status.ex から始め、特に Plug.Conn.Status.code/1 と reason_phrase/1 を確認してください。組み込みステータスとカスタムステータスが有効性をどのように定義すべきかを判断し、提案されている valid?/1 の動作と整数の扱いが既存のステータス API と整合していることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
I’m working on a library that accepts status codes (integer or atom) and want to verify that valid status values are used.
I can do this with:
try
Plug.Conn.Status.code(value)
true
rescue
_ -> false
end
But this seems like it might be more generally useful if built into Plug.Status. Would a PR for this feature be accepted?
As well, it seems that Plug.Conn.Status.code/1 for the integer case isn’t entirely correct given the error raised with an unknown value in reason_phrase/1:
def code(integer) when integer in 100..999 do
integer
end
…
That feels like it should be instead
```elixir
@valid_status_codes Map.keys(Map.merge(statuses, custom_statuses))
def code(integer) when integer in @valid_status_codes do
integer
end
- 主要言語
- Elixir
- スター
- 3k
- フォーク
- 609
- 平均マージ
- 35分
- マージ済み PR(30日)
- 6
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
elixir-plug/plug のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
elixir-plug/plug#1299 ·
-
Kind:Bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
elixir-plug/plug#757 · コメント 8 件 ·
elixir-plug/plug の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
carverauto/serviceradar#4596 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
agentjido/jido_harness#80 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
sevenseacat/cinder#235 ·