Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
IMSZ-563 add origin-auth to images fetch
Browse files Browse the repository at this point in the history
When fetching images for authenticated origins users may use
an option called 'origin-auth' as part of the fetch api.
Previously, the option was not present in the types eventhough
it was supported by the api. This PR adds the option to the
interface.
  • Loading branch information
florianmartens committed Oct 6, 2022
1 parent 52267c0 commit c3848d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-wasps-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/workers-types": patch
---

Add 'origin-auth' to RequestInitCfPropertiesImage interface. This changes fixes types for users attempting to fetch images from authenticated sources. Before this fix, users had to manually extend the fetch interface to satisfy the TS compiler.
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,12 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
* entry is the topmost layer).
*/
draw?: RequestInitCfPropertiesImageDraw[];
/**
* Fetching image from authenticated origin. Setting this property will
* pass authentication headers (Authorization, Cookie, etc.) through to
* the origin.
*/
"origin-auth"?: "share-publicly";
}

interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
Expand Down

0 comments on commit c3848d3

Please sign in to comment.