tangled
alpha
login
or
join now
whitequark.org
/
git-pages-cli
1
fork
atom
[mirror] Command-line application for uploading a site to a git-pages server
1
fork
atom
overview
issues
pulls
pipelines
Make HTTP request bodies rewindable for redirects.
miyuko
1 week ago
4851ab8d
c05d1fd2
+3
-3
1 changed file
expand all
collapse all
unified
split
main.go
+3
-3
main.go
···
295
295
}
296
296
}
297
297
298
298
+
requestBody := streamArchiveFS(uploadDir.FS(), pathPrefix, []string{})
298
299
if *pathFlag == "" {
299
299
-
request, err = http.NewRequest("PUT", siteURL.String(), nil)
300
300
+
request, err = http.NewRequest("PUT", siteURL.String(), requestBody)
300
301
} else {
301
301
-
request, err = http.NewRequest("PATCH", siteURL.String(), nil)
302
302
+
request, err = http.NewRequest("PATCH", siteURL.String(), requestBody)
302
303
}
303
304
if err != nil {
304
305
fmt.Fprintf(os.Stderr, "error: %s\n", err)
305
306
os.Exit(1)
306
307
}
307
307
-
request.Body = streamArchiveFS(uploadDir.FS(), pathPrefix, []string{})
308
308
request.ContentLength = -1
309
309
request.Header.Add("Content-Type", "application/x-tar+zstd")
310
310
request.Header.Add("Accept", "application/vnd.git-pages.unresolved;q=1.0, text/plain;q=0.9")