Skip to content

Commit cbaf026

Browse files
authored
Merge pull request #1644 from marjanovic93/main
Update HTTP headers
2 parents dcce720 + 2535eab commit cbaf026

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

CHANGELOG.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ User-visible changes worth mentioning.
88
## main
99

1010
- [#ID] Add your PR description here.
11+
- [#1644] Update HTTP headers.
1112

1213
# 5.6.5
1314

@@ -45,7 +46,7 @@ User-visible changes worth mentioning.
4546

4647
## 5.6.0.rc2
4748

48-
- [#1558] Fixed bug: able to obtain a token with default scopes even if they are not present in the
49+
- [#1558] Fixed bug: able to obtain a token with default scopes even if they are not present in the
4950
application scopes when using client credentials.
5051
- [#1567] Only filter `code` parameter if authorization_code grant flow is enabled.
5152

@@ -80,7 +81,7 @@ User-visible changes worth mentioning.
8081
## 5.5.1
8182

8283
- [#1496] Revoke `old_refresh_token` if `previous_refresh_token` is present.
83-
- [#1495] Fix `respond_to` undefined in API-only mode
84+
- [#1495] Fix `respond_to` undefined in API-only mode
8485
- [#1488] Verify client authentication for Resource Owner Password Grant when
8586
`config.skip_client_authentication_for_password_grant` is set and the client credentials
8687
are sent in a HTTP Basic auth header.
@@ -94,10 +95,10 @@ User-visible changes worth mentioning.
9495
## 5.5.0.rc2
9596

9697
- [#1473] Enable `Applications` and `AuthorizedApplications` controllers in API mode.
97-
98-
**[IMPORTANT]** you can still skip these controllers using `skip_controllers` in
98+
99+
**[IMPORTANT]** you can still skip these controllers using `skip_controllers` in
99100
`use_doorkeeper` inside `routes.rb`. Please do it in case you don't need them.
100-
101+
101102
- [#1472] Fix `establish_connection` configuration for custom defined models.
102103
- [#1471] Add support for Ruby 3.0.
103104
- [#1469] Check if `redirect_uri` exists.

lib/doorkeeper/oauth/error_response.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ def redirect_uri
5555

5656
def headers
5757
{
58-
"Cache-Control" => "no-store",
59-
"Pragma" => "no-cache",
58+
"Cache-Control" => "no-store, no-cache",
6059
"Content-Type" => "application/json; charset=utf-8",
6160
"WWW-Authenticate" => authenticate_info,
6261
}

lib/doorkeeper/oauth/token_response.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ def status
2626

2727
def headers
2828
{
29-
"Cache-Control" => "no-store",
30-
"Pragma" => "no-cache",
29+
"Cache-Control" => "no-store, no-cache",
3130
"Content-Type" => "application/json; charset=utf-8",
3231
}
3332
end

spec/lib/oauth/token_response_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
it "includes access token response headers" do
99
headers = response.headers
10-
expect(headers.fetch("Cache-Control")).to eq("no-store")
11-
expect(headers.fetch("Pragma")).to eq("no-cache")
10+
expect(headers.fetch("Cache-Control")).to eq("no-store, no-cache")
1211
end
1312

1413
it "status is ok" do

spec/requests/endpoints/token_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
it "respond with correct headers" do
1616
post token_endpoint_url(code: @authorization.token, client: @client)
1717

18-
expect(headers["Pragma"]).to eq("no-cache")
19-
expect(headers["Cache-Control"]).to be_in(["no-store", "private, no-store"])
18+
expect(headers["Cache-Control"]).to be_in(["no-store", "no-cache, no-store", "private, no-store"])
2019
expect(headers["Content-Type"]).to eq("application/json; charset=utf-8")
2120
end
2221

0 commit comments

Comments
 (0)