Skip to content

Conversation

@Badgerati
Copy link
Owner

Description of the Change

Fixes an issue with loading static content paths which contain wildcard characters. When loading singular files, Pode will now auto-escape wildcard characters like * and [ in paths.

At times, this escaping might not be required so a new -NoEscape switch has been added onto the relevant functions.

Escaping is done via [WildcardPattern]::Escape()

Related Issue

Resolves #1500

Examples

# the following path will now work, and be escaped accordingly
Set-PodeResponseAttachment -Path './[metadata].json'

# if the path is already escaped, -NoEscape can be used
Set-PodeResponseAttachment -Path './`[metadata`].json' -NoEscape

@Badgerati Badgerati added this to the 2.12.1 milestone Apr 9, 2025
@Badgerati Badgerati self-assigned this Apr 9, 2025
@Badgerati Badgerati merged commit 211e68c into develop Apr 12, 2025
27 of 28 checks passed
@Badgerati Badgerati deleted the Issue-1500 branch April 12, 2025 14:38
@Badgerati Badgerati mentioned this pull request Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write-PodeFileResponse returns 404 when a path contains square brackets

2 participants