Skip to content

Conversation

@rahearn
Copy link
Contributor

@rahearn rahearn commented Jun 2, 2022

Refactors the rake task to enable testing of the changes made in #472

All PRs:

  • Has tests
  • Documentation updated

@rei-moo rei-moo changed the base branch from main to feature-7.2 December 16, 2025 20:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the hash generation logic from the rake task into a testable TaskHelper module, enabling comprehensive testing of the whitespace handling fix introduced in PR #472.

Key Changes:

  • Extracted hash generation methods from lib/tasks/tasks.rake into a new TaskHelper module
  • Added comprehensive test coverage for inline script/style hash generation
  • Tests verify that helper tag indentation doesn't affect hash generation (the core fix from #472)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/secure_headers/task_helper.rb New module containing extracted hash generation logic with methods for finding and hashing inline scripts/styles, previously embedded in the rake task
lib/tasks/tasks.rake Refactored to use the new TaskHelper module, replacing inline method definitions with module inclusion
spec/lib/secure_headers/task_helper_spec.rb New comprehensive test suite covering hash generation for scripts and styles, including tests for the indentation-independent hashing behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@rei-moo rei-moo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rahearn Looks good! Thanks very much for your contribution. Sorry it took so long for us to get around to reviewing it. 😄

@rei-moo rei-moo merged commit 4f5686e into github:feature-7.2 Dec 16, 2025
12 checks passed
@rei-moo rei-moo mentioned this pull request Dec 16, 2025
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.

2 participants