-
Notifications
You must be signed in to change notification settings - Fork 7.6k
WebCmdlets get Retry-After from headers if StatusCode is 429 #18717
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
WebCmdlets get Retry-After from headers if StatusCode is 429 #18717
Conversation
Whilst I agree with you about the readability aspect, we should make use of the language features here to reduce the overall size of the codebase, which the ternary operator gives us. What we really need is a mechanism for a reader to convert a file on the fly to a more readable means, though that doesn't yet exist, so we have to do our best with what we have available today. Therefore I'd ask that you make use of the ternary operator in this PR as I'm sure others would either ask you to or would accept this pr and then add another in future to move to that. |
@kilasuit Done |
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.
Approving based on my prior comment
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
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) |
PR Summary
If the Status Code is 429 it tries to get the
Retry-After
property from the headers and use it asWebSession.RetryIntervalInSeconds
(I decided to use an if-else instead of a ternary operator for better code readability)
PR Context
Fixes #13188