From 881ce8f83485558994c0b6b58ae93317ba0bf8c5 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Wed, 12 Sep 2018 14:57:13 -0600 Subject: [PATCH] quote etag in header sent to hex_core --- src/rebar_pkg_resource.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rebar_pkg_resource.erl b/src/rebar_pkg_resource.erl index cfbe460f..51a63a53 100644 --- a/src/rebar_pkg_resource.erl +++ b/src/rebar_pkg_resource.erl @@ -134,8 +134,8 @@ make_vsn(_, _) -> %%------------------------------------------------------------------------------ -spec request(rebar_hex_repos:repo(), binary(), binary(), false | binary()) -> {ok, cached} | {ok, binary(), binary()} | error. -request(Config, Name, Version, ETag) -> - Config1 = Config#{http_etag => ETag}, +request(Config, Name, Version, ETag) -> + Config1 = Config#{http_etag => <<"\"", ETag/binary, "\"">>}, try hex_repo:get_tarball(Config1, Name, Version) of {ok, {200, #{<<"etag">> := ETag1}, Tarball}} -> {ok, Tarball, rebar_utils:to_binary(rebar_string:trim(rebar_utils:to_list(ETag1), both, [$"]))};