Git Product home page Git Product logo

Comments (7)

nanliu avatar nanliu commented on June 21, 2024

I would like to switch to net::http, we can remove faraday once we implement a proper redirect:
https://github.com/lostisland/faraday_middleware/blob/master/lib/faraday_middleware/response/follow_redirects.rb

from puppet-archive.

hajee avatar hajee commented on June 21, 2024

In older issues I saw you also had ideas to remove faraday. Did you start with this?

from puppet-archive.

nanliu avatar nanliu commented on June 21, 2024

I started working on #55, but got hanged up because of the redirect issue.

from puppet-archive.

jairojunior avatar jairojunior commented on June 21, 2024

+1

Perhaps a simpler solution is enough:

http://stackoverflow.com/questions/6934185/ruby-net-http-following-redirects?answertab=active#tab-top

We only need to support HTTP GET, right?

from puppet-archive.

hajee avatar hajee commented on June 21, 2024

I've been looking into this. I'm guessing issue #55 is caused by the standard Net::HTTP class and not by Faraday. It looks like Net::HTTP is reading the whole response object into memory, causing memory problems when working with big files. So when we replace Faraday by our own solution, we also have to be careful not to keep the same problem.

Wouldn't it be easier to use wget. This would still introduce a dependency, but this is a rpm dependency that, most of the times is much easier. The advantage would be a battle tested en tried http/ftp and https implementation.

It supports a lot of stuff, for example:

  • retries
  • limit rate. This could be useful when downloading files on fragile networks
  • proxies
  • redirects

from puppet-archive.

nanliu avatar nanliu commented on June 21, 2024

This module was originally written to handle both windows/linux. A native ruby solution worked better than being dependent on a package that I could not install in windows. Both wget/curl can be implemented as providers to supplement the default provider (or even default providers on Linux). The util portion can be moved to download method so the default provider can be the parent provider with the download method replaced with your preferred solution on platforms where it's suitable.

from puppet-archive.

hajee avatar hajee commented on June 21, 2024

Sorry. Forgot about Windows for a moment ;-). I'll have my stab at making a provider for unix wget.

from puppet-archive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.