Skip to content

Commit 1947edc

Browse files
committed
Release v1.17.0
1 parent fa54827 commit 1947edc

File tree

5 files changed

+41
-14
lines changed

5 files changed

+41
-14
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## v1.17.0 (2025-03-14)
4+
5+
### Enhancements
6+
7+
* [Plug.Debugger] Add dark mode and other UI improvements
8+
* [Plug.Debugger] Link `Module.function/arity` to hexdocs in exception messages
9+
* [Plug.Debugger] Support `__RELATIVEFILE__` to `PLUG_EDITOR` replacements
10+
* [Plug.SSL] Add SSL validation support for `certs_keys`
11+
12+
### Deprecations
13+
14+
* [Plug.Conn.Adapter] Make `push` an optional callback as it is no longer supported by browsers
15+
* [Plug.Conn] Deprecate `req_cookies`, `cookies`, and `resp_cookies` fields in favor of functions
16+
* [Plug.Conn] Deprecate `owner` field. Tracking responses is now part of adapters
17+
* [Plug.Test] Deprecate `use Plug.Test` in favor of imports
18+
319
## v1.16.2 (2025-03-14)
420

521
### Bug fixes

lib/plug/conn.ex

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ defmodule Plug.Conn do
3838
If you access these fields before fetching them, they will be returned as
3939
`Plug.Conn.Unfetched` structs.
4040
41-
* `body_params` - the request body params, populated through a `Plug.Parsers` parser.
41+
* `body_params` - the request body params, populated through a `Plug.Parsers` parser
4242
* `query_params` - the request query params, populated through `fetch_query_params/2`
43+
* `path_params` - the request path params, populated by routers such as `Plug.Router`
4344
* `params` - the request params, the result of merging `:body_params` on top of
4445
`:query_params` alongsaide any further changes (such as the ones done by `Plug.Router`)
4546
@@ -84,7 +85,6 @@ defmodule Plug.Conn do
8485
* `resp_body` - the response body is an empty string by default. It is set
8586
to nil after the response is sent, except for test connections. The response
8687
charset defaults to "utf-8".
87-
* `resp_cookies` - the response cookies with their name and options
8888
* `resp_headers` - the response headers as a list of tuples, `cache-control`
8989
is set to `"max-age=0, private, must-revalidate"` by default.
9090
Note: Use all lowercase for response headers.
@@ -93,7 +93,6 @@ defmodule Plug.Conn do
9393
## Connection fields
9494
9595
* `assigns` - shared user data as a map
96-
* `owner` - the Elixir process that owns the connection
9796
* `halted` - the boolean status on whether the pipeline was halted
9897
* `secret_key_base` - a secret key used to verify and encrypt cookies.
9998
These features require manual field setup. Data must be kept in the
@@ -116,12 +115,11 @@ defmodule Plug.Conn do
116115
117116
## Deprecated fields
118117
119-
* `path_params` - the request path params, populated by routers such as `Plug.Router`.
120-
Use `conn.params` instead.
121-
* `req_cookies` - the decoded request cookies (without decrypting or verifying them).
122-
Use `get_req_header/2` or `get_cookies/1` instead.
123118
* `cookies`- the request cookies with the response cookies.
124119
Use `get_cookies/1` instead.
120+
* `owner` - the Elixir process that owns the connection.
121+
* `req_cookies` - the decoded request cookies (without decrypting or verifying them).
122+
Use `get_req_header/2` or `get_cookies/1` instead.
125123
* `resp_cookies`- the request cookies with the response cookies.
126124
Use `get_resp_cookies/1` instead.
127125

lib/plug/conn/adapter.ex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ defmodule Plug.Conn.Adapter do
4949
as the body can no longer be manipulated. However, the
5050
test implementation returns the actual body so it can
5151
be used during testing.
52+
53+
Webservers must send a `{:plug_conn, :already_sent}`
54+
message to the process that called `Plug.Conn.Adapter.conn/5`.
5255
"""
5356
@callback send_resp(
5457
payload,
@@ -69,6 +72,9 @@ defmodule Plug.Conn.Adapter do
6972
as the body can no longer be manipulated. However, the
7073
test implementation returns the actual body so it can
7174
be used during testing.
75+
76+
Webservers must send a `{:plug_conn, :already_sent}`
77+
message to the process that called `Plug.Conn.Adapter.conn/5`.
7278
"""
7379
@callback send_file(
7480
payload,
@@ -89,6 +95,9 @@ defmodule Plug.Conn.Adapter do
8995
as the body in order to be consistent with the built-up
9096
body returned by subsequent calls to the test implementation's
9197
`chunk/2` function
98+
99+
Webservers must send a `{:plug_conn, :already_sent}`
100+
message to the process that called `Plug.Conn.Adapter.conn/5`.
92101
"""
93102
@callback send_chunked(payload, status :: Conn.status(), headers :: Conn.headers()) ::
94103
{:ok, sent_body :: binary | nil, payload}
@@ -124,6 +133,8 @@ defmodule Plug.Conn.Adapter do
124133
125134
If the adapter does not support server push then `{:error, :not_supported}`
126135
should be returned.
136+
137+
This callback no longer needs to be implemented, as browsers no longer support server push.
127138
"""
128139
@callback push(payload, path :: String.t(), headers :: Keyword.t()) :: :ok | {:error, term}
129140

@@ -159,4 +170,6 @@ defmodule Plug.Conn.Adapter do
159170
Returns the HTTP protocol and its version.
160171
"""
161172
@callback get_http_protocol(payload) :: http_protocol
173+
174+
@optional_callbacks push: 3
162175
end

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Plug.MixProject do
22
use Mix.Project
33

4-
@version "1.16.1"
4+
@version "1.17.0"
55
@description "Compose web applications with functions"
66
@xref_exclude [Plug.Cowboy, :ssl]
77

mix.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
%{
2-
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
3-
"ex_doc": {:hex, :ex_doc, "0.34.0", "ab95e0775db3df71d30cf8d78728dd9261c355c81382bcd4cefdc74610bef13e", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "60734fb4c1353f270c3286df4a0d51e65a2c1d9fba66af3940847cc65a8066d7"},
4-
"makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"},
5-
"makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"},
6-
"makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"},
2+
"earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"},
3+
"ex_doc": {:hex, :ex_doc, "0.37.3", "f7816881a443cd77872b7d6118e8a55f547f49903aef8747dbcb345a75b462f9", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "e6aebca7156e7c29b5da4daa17f6361205b2ae5f26e5c7d8ca0d3f7e18972233"},
4+
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
5+
"makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
6+
"makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"},
77
"mime": {:hex, :mime, "1.6.0", "dabde576a497cef4bbdd60aceee8160e02a6c89250d6c0b29e56c0dfb00db3d2", [:mix], [], "hexpm", "31a1a8613f8321143dde1dafc36006a17d28d02bdfecb9e95a880fa7aabd19a7"},
8-
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
8+
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
99
"plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"},
1010
"telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"},
1111
}

0 commit comments

Comments
 (0)