Skip to content

Commit 3d489a5

Browse files
author
Brent Cook
committed
Only test the first element of status
From f5df1ba7827581a7c771a3deffb6062551611134 Mon Sep 17 00:00:00 2001 From: Postmodern <[email protected]> Date: Thu, 4 Aug 2016 19:35:10 -0700 Subject: [PATCH 2/2] Only test the first element of status * When using webmock, the `"OK"` String is not present in `StringIO#status`.
1 parent dafd788 commit 3d489a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/robots.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def initialize(uri, user_agent)
1414

1515
io = Robots.get_robots_txt(uri, user_agent)
1616

17-
if !io || io.content_type != "text/plain" || io.status != ["200", "OK"]
17+
if !io || io.content_type != "text/plain" || io.status.first != "200"
1818
io = StringIO.new("User-agent: *\nAllow: /\n")
1919
end
2020

0 commit comments

Comments
 (0)