Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a -ContentType parameter to Set-PodeResponseAttachment #386

Closed
Badgerati opened this issue Sep 27, 2019 · 1 comment
Closed

Add a -ContentType parameter to Set-PodeResponseAttachment #386

Badgerati opened this issue Sep 27, 2019 · 1 comment

Comments

@Badgerati
Copy link
Owner

At the moment, the Set-PodeResponseAttachment function assumes the content type of the response based on the attachment/file's extension (ie: .json gets mapped to application/json).

In most cases the extensive mapping is correct. However, there should be a new -ContentType parameter on the Set-PodeResponseAttachment function that, if supplied, will be used instead of the mapping.

This new parameter should be an optional string parameter, with the help comment updated. If supplied, the $WebEvent.Response.ContentType should be set as this value instead of:

$WebEvent.Response.ContentType = (Get-PodeContentType -Extension $ext)
@Badgerati Badgerati assigned Badgerati and unassigned Badgerati Oct 1, 2019
Badgerati added a commit that referenced this issue Oct 1, 2019
Add -ContentType Parameter, helps #386
@Badgerati Badgerati added this to the 1.2.0 milestone Oct 1, 2019
@Badgerati
Copy link
Owner Author

Completed by #388

@Badgerati Badgerati mentioned this issue Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant