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

fix: [small] fix to receive partial contents #15

Merged

Conversation

s-yoshika
Copy link
Contributor

@s-yoshika s-yoshika commented Aug 14, 2018

Context

When we use core/node package by sd-step with pkg-version option, we have an error like below.

13:03:58   $ sd-step exec --pkg-version "~6.11.0" core/node "node -v"
13:03:59   ERROR: Unable to access to Habitat depot API. Unexpected status code: 206
13:03:59   Trying to fetch versions from installed packages...
13:03:59   ERROR: Failed to get package version: The specified version not found

We use Habitat API to check the versions of packages in here, but the API returns different status codes in some cases.

It returns 200 code if the contents is full,
and it returns 206 code if the contents is left

$ curl https://willem.habitat.sh/v1/depot/pkgs/core/node?range=0 -I 2>/dev/null | head -n 1
HTTP/1.1 206 Partial Content
$ curl https://willem.habitat.sh/v1/depot/pkgs/core/node?range=50 -I 2>/dev/null | head -n 1
HTTP/1.1 200 OK

Objective

This PR allows sd-step to receive partial content.

@s-yoshika s-yoshika changed the title fix: fix to receive partial contents fix: [small] fix to receive partial contents Aug 14, 2018
@tkyi tkyi merged commit fcb48cf into screwdriver-cd:master Aug 14, 2018
@kumada626 kumada626 deleted the recieve-partial-content branch August 15, 2018 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants