79283357

Date: 2024-12-15 23:27:28
Score: 0.5
Natty:
Report link

Cookie Handling: The way I was setting the Cookie header might was not correct. Typically, you'd want to set it as a complete cookie string:

   const profileUpdateResponse = await fetch(`${API_URL}/update-profile/${requestBody.user_id}/`, {
      method: 'POST',
      credentials: 'include',
      headers: {
        'Content-Type': 'application/json',
        'X-CSRFToken': csrfToken.value,
        'Cookie': `csrftoken=${csrfToken.value}; sessionid=${sessionid.value}`
      },
  body: JSON.stringify(requestBody)
});
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: lorentz kalume