We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1be8451 commit 2728b5fCopy full SHA for 2728b5f
app/models/etag_feed.rb
@@ -3,6 +3,13 @@ class EtagFeed < Feed
3
4
include Html
5
6
+ ETAG_IGNORED_PATTERSN = [
7
+ # Some pages fight spam with random encoding of addresses
8
+ /a href="mailto.*/,
9
+ # some pages use timestamp to prevent caching of css
10
+ /href="[^"]+" type=.text\/css./
11
+ ]
12
+
13
def fill_missing_details
14
return if title.present?
15
@@ -16,6 +23,10 @@ def recent_media_items(*)
16
23
return network_error_message(html_response)
17
24
end
18
25
26
+ body = ETAG_IGNORED_PATTERSN.reduce(html_response.body) do |str, pattern|
27
+ str.gsub(pattern, "")
28
+ end
29
19
30
new_checksum = get_etag.presence || Digest::MD5.hexdigest(html_response.body)
20
31
if html_response.code == 304 || new_checksum == etag
21
32
[]
0 commit comments