Skip to content

Commit 86e5b57

Browse files
committed
Merge pull request #218 from katrinleinweber/patch-1
secure DOIs
2 parents 54d9355 + c6ec841 commit 86e5b57

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/doi_detector.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def uri?
1010

1111
def doi?
1212
return true if start_with?('http://dx.doi.org/')
13+
return true if start_with?('https://doi.org/')
1314
return true if start_with?('doi:')
1415
false
1516
end
@@ -18,6 +19,6 @@ def url_for_doi
1819
return nil unless doi?
1920
return self if uri?
2021
# Otherwise, 'doi:...'
21-
return gsub('doi:','http://dx.doi.org/')
22+
return gsub('doi:','https://doi.org/')
2223
end
23-
end
24+
end

0 commit comments

Comments
 (0)