Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Gateway Improvements: Streaming, Conditional and Range Requests #1989

Merged
merged 3 commits into from
May 8, 2019

Commits on May 6, 2019

  1. fix(gateway): streaming compressed payload

    This change simplifies code responsible for streaming response
    and makes the streaming actually work by telling the payload compression
    stream to flush its content on every read().
    (previous version was buffering entire thing in Hapi's compressor memory)
    
    We also do content-type detection based on the beginning of the stream
    by peeking at first `fileType.minimumBytes` bytes.
    
    License: MIT
    Signed-off-by: Marcin Rataj <lidel@lidel.org>
    lidel committed May 6, 2019
    Configuration menu
    Copy the full SHA
    a7a1046 View commit details
    Browse the repository at this point in the history
  2. feat(gateway): range and conditional requests

    - Switched from deprecated `hapi` and `joi` to `@hapi/hapi` and `@hapi/joi`
    - Added support for Conditional Requests (RFC7232)
      - Returning `304 Not Modified` if `If-None-Match` is a CID matching `Etag`
      - Added `Last-Modified` to `/ipfs/` responses (improves client-side caching)
      - Always returning `304 Not Modified`
        when `If-Modified-Since` is present for immutable `/ipfs/`
    - Added support for Byte Range requests (RFC7233, Section-2.1)
    - Added support for `?filename=` parameter (improves downloads of raw cids)
    
    License: MIT
    Signed-off-by: Marcin Rataj <lidel@lidel.org>
    lidel committed May 6, 2019
    Configuration menu
    Copy the full SHA
    373eedc View commit details
    Browse the repository at this point in the history

Commits on May 8, 2019

  1. refactor: remove redundant try/catch

    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    alanshaw committed May 8, 2019
    Configuration menu
    Copy the full SHA
    7e237fc View commit details
    Browse the repository at this point in the history