Skip to content

Commit

Permalink
Merge branch 'pl/fix-github-releases-download-file'
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Mar 16, 2022
2 parents fc4d30b + 3e20efb commit f4e385e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: 89a8f665f70644989adf70cd132bf0f38ef3414d
revision: 56fc95c3a9981e2467afe6f61ff466e5e550ed48
branch: master
specs:
goo (0.0.2)
Expand All @@ -49,7 +49,7 @@ GEM
addressable (2.3.5)
ansi (1.5.0)
ast (2.4.2)
bcrypt (3.1.16)
bcrypt (3.1.17)
builder (3.2.4)
coderay (1.1.3)
concurrent-ruby (1.1.9)
Expand Down Expand Up @@ -160,13 +160,13 @@ GEM
rexml (3.2.5)
rsolr (1.1.2)
builder (>= 2.1.2)
rubocop (1.25.1)
rubocop (1.26.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.15.1, < 2.0)
rubocop-ast (>= 1.16.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.16.0)
Expand Down Expand Up @@ -195,13 +195,13 @@ GEM
tzinfo (0.3.60)
unf (0.1.4)
unf_ext
unf_ext (0.0.8)
unf_ext (0.0.8.1)
unicode-display_width (2.1.0)
uuid (2.3.9)
macaddr (~> 1.0)

PLATFORMS
ruby
x86_64-darwin-21

DEPENDENCIES
activesupport (~> 4)
Expand Down Expand Up @@ -234,4 +234,4 @@ DEPENDENCIES
thin

BUNDLED WITH
2.1.4
2.3.5
4 changes: 3 additions & 1 deletion lib/ontologies_linked_data/utils/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def self.download_file(uri, limit = 10)

file_size = res.read_header['content-length'].to_i
begin
filename = res.read_header['content-disposition'].match(/filename=\"(.*)\"/)[1] if filename.nil?
content_disposition = res.read_header['content-disposition']
filenames = content_disposition.match(/filename=\"(.*)\"/) || content_disposition.match(/filename=(.*)/)
filename = filenames[1] if filename.nil?
rescue
filename = LinkedData::Utils::Triples.last_iri_fragment(uri.request_uri) if filename.nil?
end
Expand Down

0 comments on commit f4e385e

Please sign in to comment.