Add FileNameStar to MultipartFileContent in WebCmdlets#19467
Add FileNameStar to MultipartFileContent in WebCmdlets#19467daxian-dbw merged 6 commits intoPowerShell:masterfrom
Conversation
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
|
@CarloToso Can you please update the PR description with more context information about why adding |
|
@daxian-dbw Updated the PR description, I can't confirm it fixes the issue because it depends on the endpoint that recieves the Multipart/Form-Data |
|
Thanks @CarloToso. Let's wait for the user to verify the fix. |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
This did not fix the customer's issue. Do we still want to proceed with this fix? |
|
@TravisEz13 I think we should merge this PR anyway |
|
This add useful standard behavior. |
|
I pinged WG-Cmdlets to triage. |
|
Looking at the HTTP specs, it seems that this is useful even though it doesn't solve the original problem. |
|
if we're adding new or altering current behavior, there should be some validation. |
JamesWTruher
left a comment
There was a problem hiding this comment.
This really should have some validation of the behavior.
| // .NET does not enclose field names in quotes, however, modern browsers and curl do. | ||
| result.Headers.ContentDisposition.FileName = "\"" + file.Name + "\""; | ||
| result.Headers.ContentDisposition.FileName = file.Name; | ||
| result.Headers.ContentDisposition.FileNameStar = file.Name; |
There was a problem hiding this comment.
I think we should have tests for this new behavior.
There was a problem hiding this comment.
Done
I'll fix it tomorrow
Done
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
@PowerShell/wg-powershell-cmdlets discussed this briefly and agree on supporting FileNameStar. The linked issue is not resolved by this PR, so we removed the link to the issue. |
JamesWTruher
left a comment
There was a problem hiding this comment.
thanks for adding the validation!
|
🎉 Handy links: |
|
It is possible this change is breaking results in an malformed request. |
|
|
||
| // .NET does not enclose field names in quotes, however, modern browsers and curl do. | ||
| contentDisposition.Name = "\"" + LanguagePrimitives.ConvertTo<string>(fieldName) + "\""; | ||
| contentDisposition.Name = LanguagePrimitives.ConvertTo<string>(fieldName); |
There was a problem hiding this comment.
This broke IWR for us when we upgraded to 7.4. We use IWR in a publish script to upload a zip to an internal PERL / CGI-based website. AFAICT the PERL CGI module requires field name values to be quoted. See #23843
PR Summary
PR Context
Removed linked issue as this PR doesn't fix that issue
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).