This repository was archived by the owner on Jun 9, 2025. It is now read-only.
Commit a93b1af
committed
fix: throw an error if we are passing an ambiguous set of options to the purge api
Prior to this commit, a call to `purgeCache` could supply any combination of siteID, siteSlug,
and domain.
If that does happen then the purge api endpoint as of today will do the following:
- If the request passed in SiteID and either SiteSlug or Domain, then the SiteID would be used
- If the request passed in SiteSlug and Domain, then the SiteSlug would be used
This is likely not what the user is wanting.
I've opened a pull-request in netlify-server to make it return an error response instead,
but I think we can also improve the situation in this package by throwing an earlier error,
one which they the user can spot when developing locally1 parent 364fa59 commit a93b1af
1 file changed
+14
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
| |||
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
60 | | - | |
| 68 | + | |
61 | 69 | | |
62 | | - | |
| 70 | + | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
67 | | - | |
68 | | - | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
| |||
0 commit comments