Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable request body streaming #12

Closed
wants to merge 14 commits into from
Closed

Enable request body streaming #12

wants to merge 14 commits into from

Commits on May 1, 2017

  1. Allow any IO object in FormData::File

    Previously we allowed only File and StringIO objects as an input to
    FormData::File, but we can generalize that to any IO object that
    responds to #read and #size (which includes Tempfile,
    ActionDispatch::Http::UploadedFile etc).
    janko committed May 1, 2017
    Configuration menu
    Copy the full SHA
    aa48de1 View commit details
    Browse the repository at this point in the history
  2. Open File for given path in binary mode

    That way different operating systems won't attempt to convert newline
    characters to their internal representation, instead the file content
    will always be retrieved byte-for-byte as is.
    janko committed May 1, 2017
    Configuration menu
    Copy the full SHA
    bddb450 View commit details
    Browse the repository at this point in the history
  3. Officially support Pathname in FormData::File.new

    Previously Pathname was implicitly supported, though extracting filename
    wasn't working. With the recent refactoring this stopped working, so we
    make the Pathname support explicit.
    janko committed May 1, 2017
    Configuration menu
    Copy the full SHA
    829936f View commit details
    Browse the repository at this point in the history

Commits on May 2, 2017

  1. Make all components into IO objects

    By changing all components to use an IO object as a base, we can
    implement a common IO interface for all components, which delegates to
    the underlying IO object.
    
    This enables streaming multipart data into the request body, avoiding
    loading the whole multipart data into memory when File parts are backed
    by File objects.
    
    See httprb/http#409 for the new streaming API.
    janko committed May 2, 2017
    Configuration menu
    Copy the full SHA
    fc84d5f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9298959 View commit details
    Browse the repository at this point in the history
  3. Make CompositeIO convert strings to StringIOs

    By delegating handling strings to CompositeIO we can remove a lot of the
    StringIO.new clutter when instantiating CompositeIO objects.
    janko committed May 2, 2017
    Configuration menu
    Copy the full SHA
    22af98d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e9c4cef View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    32be2d3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    41f0b40 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2017

  1. Increase maximum allowed complexity in Rubocop

    We increase it for FormData::CompositeIO#read.
    janko committed May 3, 2017
    Configuration menu
    Copy the full SHA
    42e44cd View commit details
    Browse the repository at this point in the history

Commits on May 7, 2017

  1. Use a buffer when reading IO files in CompositeIO

    This way we're not creating a new string for each chunk read, instead
    each chunk will be read into an existing string object (a "buffer"),
    replacing any previous content.
    janko committed May 7, 2017
    Configuration menu
    Copy the full SHA
    7abde00 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2017

  1. Configuration menu
    Copy the full SHA
    ad1dbef View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9153140 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    43bff5b View commit details
    Browse the repository at this point in the history