Permalink
Browse files

Only handle 200 responses

  • Loading branch information...
1 parent 9861405 commit 6e0e393aa41b4b7aa6bdaebd96b7a352d48d4ed8 amix committed Jul 17, 2014
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/webpage-info.js
  2. +1 −1 package.json
  3. +1 −1 src/webpage-info.coffee
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -3,7 +3,7 @@
"description": "Return a webpage's title and favicon.",
"keywords": ["oembed", "preview"],
"author": "amix",
- "version": "0.0.1",
+ "version": "0.0.2",
"dependencies": {
"request": ">=2.34.0"
},
View
@@ -7,7 +7,7 @@ exports.parse = (url, callback, timeout) ->
args = {"url": url, "timeout": timeout}
request(args, (error, response, body) ->
- if error
+ if error or response.statusCode != 200
callback({'error': error})
else
title = body.match(RE_TITLE)

0 comments on commit 6e0e393

Please sign in to comment.