From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-0.9 required=3.0 tests=AWL,BAYES_00,FREEMAIL_FROM, URIBL_BLOCKED shortcircuit=no autolearn=ham version=3.3.2 X-Original-To: cmogstored-public@bogomips.org Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 9B0671F72F for ; Wed, 4 Feb 2015 00:28:42 +0000 (UTC) Received: by mail-pa0-f41.google.com with SMTP id kq14so102902209pab.0 for ; Tue, 03 Feb 2015 16:28:42 -0800 (PST) X-Received: by 10.68.181.69 with SMTP id du5mr42089612pbc.157.1423009722123; Tue, 03 Feb 2015 16:28:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.70.127.239 with HTTP; Tue, 3 Feb 2015 16:28:20 -0800 (PST) In-Reply-To: References: <20150204002024.GA882@dcvr.yhbt.net> From: David Birdsong Date: Tue, 3 Feb 2015 16:28:20 -0800 Message-ID: Subject: Re: help w/ md5sum PUT To: Eric Wong Cc: mogile@googlegroups.com, cmogstored-public@bogomips.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: PublicInbox::Filter 0.0.1 List-Id: On Tue, Feb 3, 2015 at 4:24 PM, David Birdsong wrote: > > > On Tue, Feb 3, 2015 at 4:20 PM, Eric Wong wrote: > >> David Birdsong wrote: >> > On Tue, Feb 3, 2015 at 3:59 PM, David Birdsong < >> david.birdsong@gmail.com> >> > wrote: >> > >> > > Hi Eric, I'm troubleshooting my client that's PUTing to cmogstored and >> > > getting 400 response codes. >> > > >> > > If I supply a header: >> > > Content-MD5: MJH_pL-pTjsfQV4PiYDLFA== >> >> How are you generating that base64? >> >> I could be wrong, but it the '_' (underscore) is not a part of the >> normal set of characters used by base64. Perhaps you're using a base64 >> variant? (there's one URL-friendly variant, at least) >> >> It doesn't look like the gnulib base64 module (which cmogstored uses) >> handles underscore... (warning: I'm sleep deprived and haven't touched >> a computer in a few days, so maybe I'm missing something, too) >> > > It's from Golang's base64 package: > return base64.URLEncoding.EncodeToString(m.checksum.Sum(nil)) > > ...but yeah, here's python's re-encoding: > >>> base64.urlsafe_b64encode( > base64.decodestring('MJH_pL-pTjsfQV4PiYDLFA==')) > > 'MJHpLpTjsfQV4PiYDLFA' > > > I'll try playing around with other Go encoding methods. > Ok, I swapped in base64.StdEncoding and it worked. http://golang.org/pkg/encoding/base64/#pkg-index I expected the base64.URLEncoding to be the way to go. Case closed. Thanks!