Rainbows! Rack HTTP server user/dev discussion
 help / Atom feed
From: Eric Wong <e@80x24.org>
To: rainbows-public@bogomips.org
Subject: [PATCH] tests: use correct file:// URL for random_blob path
Date: Thu, 17 Nov 2016 02:41:55 +0000
Message-ID: <20161117024155.21980-1-e@80x24.org> (raw)

Apparently RFC1738 designates hostname support for file:// and
curl historically had this wrong, but my current curl version
(7.38.0-4+deb8u5 from Debian 8) is stricter.  Anyways, this seems
to handle $PWD with spaces and possibly other strange
characters, so URL encoding here doesn't seem to be strictly
necssary.
---
 t/byte-range-common.sh | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/t/byte-range-common.sh b/t/byte-range-common.sh
index 2c12a8b..3418394 100644
--- a/t/byte-range-common.sh
+++ b/t/byte-range-common.sh
@@ -34,14 +34,15 @@ check_content_range () {
 }
 
 t_begin "read random blob sha1s" && {
-	sha1_head=$(curl -sSff $range_head file://random_blob | rsha1)
-	sha1_tail=$(curl -sSff $range_tail file://random_blob | rsha1)
-	sha1_mid=$(curl -sSff $range_mid file://random_blob | rsha1)
-	sha1_n1=$(curl -sSff $range_n1 file://random_blob | rsha1)
-	sha1_n2=$(curl -sSff $range_n2 file://random_blob | rsha1)
-	sha1_1b_head=$(curl -sSff $range_1b_head file://random_blob | rsha1)
-	sha1_1b_tail=$(curl -sSff $range_1b_tail file://random_blob | rsha1)
-	sha1_1b_mid=$(curl -sSff $range_1b_mid file://random_blob | rsha1)
+	file="file://$(pwd)/random_blob"
+	sha1_head=$(curl -sSff $range_head $file | rsha1)
+	sha1_tail=$(curl -sSff $range_tail $file | rsha1)
+	sha1_mid=$(curl -sSff $range_mid $file | rsha1)
+	sha1_n1=$(curl -sSff $range_n1 $file | rsha1)
+	sha1_n2=$(curl -sSff $range_n2 $file | rsha1)
+	sha1_1b_head=$(curl -sSff $range_1b_head $file | rsha1)
+	sha1_1b_tail=$(curl -sSff $range_1b_tail $file | rsha1)
+	sha1_1b_mid=$(curl -sSff $range_1b_mid $file | rsha1)
 	sha1_all=$(rsha1 < random_blob)
 	echo "$sha1_all=$sha1_n1"
 }
-- 
EW


                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://bogomips.org/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161117024155.21980-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=rainbows-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror https://bogomips.org/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox