-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
FilePair.SetExpiry generates a 'System.ArgumentOutOfRangeException' when Expiry header contains a negative value. #176
Comments
On second glance, a modification to the Replicant/src/Replicant/Extensions.cs Line 163 in 3c9ce50
|
@SamuelJBeer thanks for raising the issue. do you want to have a go at submitting a pull request to fix it? |
Aye, I don't mind giving it a stab, @SimonCropp . Do you have any particular preference as to the implemented strategy at all? For instance, I'm leaning towards simply treating negative values as though they were null, however the intent behind the negative value could potentially be interpreted as indicating a resource doesn't expire and to cache it indefinitely. Ultimately I guess it boils down to whether as a consequence of encountering a negative Expiry header value, the end result of inevitably executing |
i would assume -1 means we should not cache it at all? so no file saved to disk? |
Your assumption would be invariably correct. I had admittedly overlooked that possibility earlier as the value of Cache-Control was |
can you submit a Pull Request for this |
Bit of an edge-case issue but in the event that the Expiry header contains a negative value f.e.
-1
, the subsequent call toFilePair.SetExpiry()
will result in anSystem.ArgumentOutOfRangeException
being thrown, as illustrated by the following stack trace.As my particular use-case was already utilising a
DelegateHandler
to perform header manipulation, incorporating the injection of a positive value into Expiry in the event it doesn't contain one wasn't an issue. A suggestion for a more concrete solution to this particular issue however, would be to assert thatExpiry
contains a positive value within theFirePair.SetExpiry
method itself.The text was updated successfully, but these errors were encountered: