mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat(api): add :email unsubscribe/:email to the deprecated (#50497)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
+3
-4
@@ -32,6 +32,8 @@ export const getCsrfToken = (setCookies: string[]): string | undefined => {
|
||||
return csrfToken;
|
||||
};
|
||||
|
||||
export const ORIGIN = 'https://www.freecodecamp.org';
|
||||
|
||||
export function superRequest(
|
||||
resource: string,
|
||||
config: {
|
||||
@@ -43,10 +45,7 @@ export function superRequest(
|
||||
const { method, setCookies } = config;
|
||||
const { sendCSRFToken = true } = options ?? {};
|
||||
|
||||
const req = requests[method](resource).set(
|
||||
'Origin',
|
||||
'https://www.freecodecamp.org'
|
||||
);
|
||||
const req = requests[method](resource).set('Origin', ORIGIN);
|
||||
|
||||
if (setCookies) {
|
||||
void req.set('Cookie', setCookies);
|
||||
|
||||
Reference in New Issue
Block a user