Skip to content

Commit

Permalink
feat: add Vary: Accept to all non-error responses (#414)
Browse files Browse the repository at this point in the history
Was already implemented in #408 was accidentally removed in #411
  • Loading branch information
thisismana authored Oct 2, 2024
1 parent 3b404fe commit 35f7c20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/image-handler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ function getResponseHeaders(isError: boolean = false, statusCode: number = Statu

if (isError) {
headers['Content-Type'] = 'application/json';
} else {
headers['Vary'] = 'Accept';
}

switch (statusCode) {
Expand Down
1 change: 1 addition & 0 deletions source/image-handler/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe('index', () => {
'Content-Type': 'image/jpeg',
'Cache-Control': 'max-age=31536000, immutable',
Expires: undefined,
Vary: 'Accept',
'Last-Modified': undefined,
},
body: '/9j/4QC8RXhpZgAASUkqAAgAAAAGABIBAwABAAAAAQAAABoBBQABAAAAVgAAABsBBQABAAAAXgAAACgBAwABAAAAAgAAABMCAwABAAAAAQAAAGmHBAABAAAAZgAAAAAAAABIAAAAAQAAAEgAAAABAAAABgAAkAcABAAAADAyMTABkQcABAAAAAECAwAAoAcABAAAADAxMDABoAMAAQAAAP//AAACoAQAAQAAAAEAAAADoAQAAQAAAAEAAAAAAAAA/+IB8ElDQ19QUk9GSUxFAAEBAAAB4GxjbXMEIAAAbW50clJHQiBYWVogB+IAAwAUAAkADgAdYWNzcE1TRlQAAAAAc2F3c2N0cmwAAAAAAAAAAAAAAAAAAPbWAAEAAAAA0y1oYW5keem/Vlo+AbaDI4VVRvdPqgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKZGVzYwAAAPwAAAAkY3BydAAAASAAAAAid3RwdAAAAUQAAAAUY2hhZAAAAVgAAAAsclhZWgAAAYQAAAAUZ1hZWgAAAZgAAAAUYlhZWgAAAawAAAAUclRSQwAAAcAAAAAgZ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