From 8a4114a3dad4bc7b2b7f44f5423e05f97abe9f27 Mon Sep 17 00:00:00 2001 From: David Liu Date: Sun, 4 Aug 2024 09:51:13 -0400 Subject: [PATCH] Fix AJAX requests missing CSFR header in Result component --- Changelog.md | 1 + app/assets/javascripts/Components/Result/result.jsx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Changelog.md b/Changelog.md index 2cf46365a4..25467cb732 100644 --- a/Changelog.md +++ b/Changelog.md @@ -31,6 +31,7 @@ - Fix rename confirmation check triggering even upon no rename input (#7124) - Ensured that the assignment deadline is used as a placeholder if token_end_date is not present. (#7128) - Fixed grader view rendering when a pre-defined annotation's content is blank (#7147) +- Fixed AJAX requests in grader view, which were missing CSRF token headers (#7174) ### 🔧 Internal changes diff --git a/app/assets/javascripts/Components/Result/result.jsx b/app/assets/javascripts/Components/Result/result.jsx index 719d63611a..7cfa40d91e 100644 --- a/app/assets/javascripts/Components/Result/result.jsx +++ b/app/assets/javascripts/Components/Result/result.jsx @@ -1,6 +1,10 @@ import React from "react"; import {render} from "react-dom"; +// TODO: This import seems to be required to automatically include the X-CSRF-TOKEN header on +// jQuery AJAX requests in this component, unlike all other pages. Requires further investigation. +import "@rails/ujs"; + import {LeftPane} from "./left_pane"; import {RightPane} from "./right_pane"; import {SubmissionSelector} from "./submission_selector";