Skip to content

Conversation

@prestoncraw
Copy link
Contributor

No description provided.

return;
}

private static string[] excludeHeaderBase = [

Check notice

Code scanning / CodeQL

Missed 'readonly' opportunity Note

Field 'excludeHeaderBase' can be 'readonly'.

Copilot Autofix

AI about 2 months ago

To fix this issue, the excludeHeaderBase field declaration at line 133 should be changed from:

private static string[] excludeHeaderBase = [
    "Set-Cookie", // Handled seperately
    "transfer-encoding" // Can break data transfer
];

to:

private static readonly string[] excludeHeaderBase = [
    "Set-Cookie", // Handled seperately
    "transfer-encoding" // Can break data transfer
];

This ensures the reference to the array cannot be re-assigned after static initialization, which is what the CodeQL warning is requesting. No additional imports or methods are needed. No other code needs to change, as the usage of excludeHeaderBase is not shown to involve reassignment.


Suggested changeset 1
src/Gemstone.Web/WebExtensions.cs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/Gemstone.Web/WebExtensions.cs b/src/Gemstone.Web/WebExtensions.cs
--- a/src/Gemstone.Web/WebExtensions.cs
+++ b/src/Gemstone.Web/WebExtensions.cs
@@ -130,7 +130,7 @@
             return;
         }
 
-        private static string[] excludeHeaderBase = [
+        private static readonly string[] excludeHeaderBase = [
                 "Set-Cookie", // Handled seperately
                 "transfer-encoding" // Can break data transfer
         ];
EOF
@@ -130,7 +130,7 @@
return;
}

private static string[] excludeHeaderBase = [
private static readonly string[] excludeHeaderBase = [
"Set-Cookie", // Handled seperately
"transfer-encoding" // Can break data transfer
];
Copilot is powered by AI and may make mistakes. Always verify output.
@clackner-gpa clackner-gpa merged commit 6baa5b3 into master Nov 13, 2025
3 checks passed
@clackner-gpa clackner-gpa deleted the development branch November 13, 2025 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants