Commit 9c0d4f6e authored by Jacob Vosmaer's avatar Jacob Vosmaer

Workhorse: clean up httprs test tempfiles

parent 8baad3c7
...@@ -53,6 +53,10 @@ func (f *fakeRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { ...@@ -53,6 +53,10 @@ func (f *fakeRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
if err := os.Remove(fw.tmp.Name()); err != nil {
return nil, err
}
if f.downgradeZeroToNoRange { if f.downgradeZeroToNoRange {
// There are implementations that downgrades bytes=0- to a normal un-ranged GET // There are implementations that downgrades bytes=0- to a normal un-ranged GET
if r.Header.Get("Range") == "bytes=0-" { if r.Header.Get("Range") == "bytes=0-" {
...@@ -79,6 +83,10 @@ func newRSFactory(flags int) RSFactory { ...@@ -79,6 +83,10 @@ func newRSFactory(flags int) RSFactory {
if err != nil { if err != nil {
return nil return nil
} }
if err := os.Remove(tmp.Name()); err != nil {
return nil
}
for i := 0; i < SZ; i++ { for i := 0; i < SZ; i++ {
tmp.WriteString(fmt.Sprintf("%04d", i)) tmp.WriteString(fmt.Sprintf("%04d", i))
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment