You've already forked AstralRinth
c8279481f8
* Revert "Implement Labrinth Canary API flag (#5531)"
This reverts commit 3b21944a75.
* Use Labrinth-Canary header instead of cookie for API canary
* prepr
* fix rebase
16 lines
358 B
TypeScript
16 lines
358 B
TypeScript
export const LABRINTH_CANARY_HEADER = 'Labrinth-Canary'
|
|
export const LABRINTH_CANARY_VALUE = 'always'
|
|
|
|
export function withLabrinthCanaryHeader(headers: Record<string, string> = {}) {
|
|
const flags = useFeatureFlags()
|
|
|
|
if (!flags.value.labrinthApiCanary) {
|
|
return headers
|
|
}
|
|
|
|
return {
|
|
...headers,
|
|
[LABRINTH_CANARY_HEADER]: LABRINTH_CANARY_VALUE,
|
|
}
|
|
}
|