Skip to content
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

Use Time.parse_safely in Feed.last_modified_from_header. #129

Merged
merged 1 commit into from
Feb 28, 2013
Merged

Use Time.parse_safely in Feed.last_modified_from_header. #129

merged 1 commit into from
Feb 28, 2013

Conversation

benubois
Copy link
Contributor

This helps prevent parse failures when there is a problem with the last modified header. For example if the Last-Modified header is empty like on http://feeds.kottke.org/main.

Looks like most of feedzirra already uses parse_safely for Time parsing.

curl -v http://feeds.kottke.org/main
* About to connect() to feeds.kottke.org port 80 (#0)
*   Trying 216.243.171.10...
* connected
* Connected to feeds.kottke.org (216.243.171.10) port 80 (#0)
> GET /main HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
> Host: feeds.kottke.org
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Mon, 19 Nov 2012 04:33:38 GMT
< Server: Apache
< X-Powered-By: PHP/5.3.2-1ubuntu4.18
< Last-Modified: 
< Transfer-Encoding: chunked
< Content-Type: text/xml
< Vary: Accept-Encoding, User-Agent
< 

This helps prevent parse failures when there is a problem with the last
modified header. For example if the Last-Modified header is empty like on
http://feeds.kottke.org/main.
ezkl added a commit that referenced this pull request Feb 28, 2013
Use Time.parse_safely in Feed.last_modified_from_header.
@ezkl ezkl merged commit 1715124 into feedjira:master Feb 28, 2013
@ezkl
Copy link
Contributor

ezkl commented Feb 28, 2013

Thanks, @benubois!

ezkl added a commit that referenced this pull request Feb 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants