swift icon indicating copy to clipboard operation
swift copied to clipboard

Allow defining the format to parse `Last-Modified` headers

Open ernesto-jimenez opened this issue 7 years ago • 1 comments

Problem: we are using the package to integrate with a swift server that returns the Last-Modified header with UTC TZ instead of GMT.

This causes time.Parse(http.TimeFormat, res.Header.Get("Last-Modified")) to fail, because the TZ should be GMT instead of UTC.

We have rolled-out a temporary with a custom http.RoundTripper that fixes the headers. However, it will be nicer to be able to configure the time format for cases like this.

Would you be open to receive a PR that makes the time format configurable?

I understand is diverging from the specs, but the reality is sometimes implementors diverge from the spec and we have to adapt.

Thanks! Ernesto

ernesto-jimenez avatar Aug 25 '16 11:08 ernesto-jimenez

By all means send a PR. If you put the time string in the Connection object and make an empty string do the right thing that would be perfect.

ncw avatar Aug 25 '16 13:08 ncw