Permalink
Browse files

Add .mobi and .epub to exclusions

  • Loading branch information...
1 parent 6681588 commit 573e3c04d002cbb060c8c99bd624af08d07f43cf @jaimeiniesta jaimeiniesta committed Nov 18, 2012
Showing with 9 additions and 1 deletion.
  1. +1 −1 lib/site_validator/sitemap.rb
  2. +2 −0 spec/samples/exclusions.html
  3. +6 −0 spec/samples/exclusions.xml
@@ -78,7 +78,7 @@ def looks_like_html?(url)
scheme = u.scheme if u.scheme
extension = u.path.split(".").last if u.path
- (scheme =~ /http[s]?/i) && (extension !~ /gif|jpg|jpeg|png|tiff|bmp|txt|pdf|doc|rtf|xml|xls|csv|wav|mp3|ogg|zip|rar|tar|gz/i)
+ (scheme =~ /http[s]?/i) && (extension !~ /gif|jpg|jpeg|png|tiff|bmp|txt|pdf|mobi|epub|doc|rtf|xml|xls|csv|wav|mp3|ogg|zip|rar|tar|gz/i)
end
def xml_locations
@@ -28,6 +28,8 @@
<a href="/file.pdf">link</a><br />
<a href="/file.txt">link</a><br />
+ <a href="/file.mobi">link</a><br />
+ <a href="/file.epub">link</a><br />
<a href="/file.doc">link</a><br />
<a href="/file.xls">link</a><br />
<a href="/file.rtf">link</a><br />
@@ -42,6 +42,12 @@ Content-Type: text/xml
<url>
<loc>http://example.com/file.txt</loc>
</url>
+ <url>
+ <loc>http://example.com/file.mobi</loc>
+ </url>
+ <url>
+ <loc>http://example.com/file.epub</loc>
+ </url>
<url>
<loc>http://example.com/file.doc</loc>
</url>

0 comments on commit 573e3c0

Please sign in to comment.