Skip to content

gracefully handle null within 'stripControls', #906#907

Merged
jeremiahjstacey merged 4 commits into
ESAPI:developfrom
ThrawnCA:github-906-null-setheader
Jul 17, 2026
Merged

gracefully handle null within 'stripControls', #906#907
jeremiahjstacey merged 4 commits into
ESAPI:developfrom
ThrawnCA:github-906-null-setheader

Conversation

@ThrawnCA

@ThrawnCA ThrawnCA commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@jeremiahjstacey

Copy link
Copy Markdown
Collaborator

@ThrawnCA
It would be greatly appreciated if you could also add a test in the StringUtilitiesTest for strip controls.
There appear to be no tests for this method in that class currently.

Bare minimum would be a simple validation that when null is provided, null is returned. If you're willing and able to provide more case coverage that would certainly be beneficial, but beyond the scope of this change.

Thank you for the contributions to the project.

- Check valid string, control characters, empty string, whitespace, and null
@ThrawnCA

ThrawnCA commented Feb 6, 2026

Copy link
Copy Markdown
Contributor Author

@ThrawnCA It would be greatly appreciated if you could also add a test in the StringUtilitiesTest for strip controls. There appear to be no tests for this method in that class currently.

Done.

I notice that this project seems unready for Java 17. It fails module access checks. Also, several tests within EncryptedUtilsPropertiesTest fail because Properties.store attempts to call ReferenceEncryptedProperties.entrySet, which is specifically disallowed.

FYI In order to make the Surefire plugin run successfully (apart from EncryptedPropertiesUtilsTest), I updated its configuration locally to:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${version.surefire}</version>
    <configuration>
        <argLine>
            --add-opens java.base/java.lang=ALL-UNNAMED
            --add-opens java.base/java.util=ALL-UNNAMED
            --add-opens java.base/java.util.regex=ALL-UNNAMED
            --add-opens java.base/java.text=ALL-UNNAMED
            --add-opens java.logging/java.util.logging=ALL-UNNAMED
        </argLine>
    </configuration>
</plugin>

@jeremiahjstacey jeremiahjstacey left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me.

@jeremiahjstacey
jeremiahjstacey merged commit bc21afe into ESAPI:develop Jul 17, 2026
1 check passed
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