-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Add FileNameStar to MultipartFileContent in WebCmdlets #19467
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
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have tests for this new behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).