Skip to content

Commit

Permalink
avoid adding .pdf to Manuscript#pdf_url
Browse files Browse the repository at this point in the history
  • Loading branch information
tatums committed Apr 30, 2024
1 parent 948e099 commit dc0e12b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/arxiv/models/manuscript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def available_in_pdf?
def pdf_url
if available_in_pdf?
url = links.find { |l| l.content_type == "application/pdf" }.url
url = StringScrubber.force_ssl_url(url)
"#{url}.pdf" unless url =~ /\.pdf$/
StringScrubber.force_ssl_url(url)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/arxiv/models/manuscript_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module Arxiv

describe "pdf_url" do
it "should return the url to download the manuscript in PDF format" do
expect(@manuscript.pdf_url).to eql('https://arxiv.org/pdf/1202.0819v1.pdf')
expect(@manuscript.pdf_url).to eql('https://arxiv.org/pdf/1202.0819v1')
end
end

Expand Down

0 comments on commit dc0e12b

Please sign in to comment.