Skip to content

Commit

Permalink
Merge pull request #129 from MrCreosote/develop
Browse files Browse the repository at this point in the history
Bump version, release notes, docs
  • Loading branch information
MrCreosote authored Nov 11, 2020
2 parents 62598e6 + c40597e commit 5db1e52
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,21 @@ RETURNS: an ACL.
## Download a file from a node
```
AUTHORIZATION OPTIONAL
GET /node/<id>?download[_raw]
GET /node/<id>?download[_raw][&seek=#][&length=#]
RETURNS: the file content.
```

`?download_raw`, as opposed to `?download`, causes the `Content-Disposition` header to be
omitted.

`seek` causes the first `#` bytes of the file to be skipped. A `seek` value greater than or equal
to the file size is an error. Defaults to 0.

`length` determines the number of bytes of the file to return after skipping `seek` bytes.
`length` may be greater than the remaining file length. Defaults to 0, which indicates that the
remainder of the file should be returned.

## Set a node to be publicly readable
```
AUTHORIZATION REQUIRED
Expand Down
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.1.1

- Added seek & length parameters to file download requests

# 0.1.0

- Initial release
2 changes: 1 addition & 1 deletion app/blobstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

const (
name = "blobstore"
version = "0.1.0"
version = "0.1.1"
shockname = "Shock"
shockver = "0.9.6" // do not increment
deprecation = "The id and version fields are deprecated."
Expand Down
2 changes: 1 addition & 1 deletion service/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ func (t *TestSuite) TestStoreAndGetWithFilename() {
t.checkFile(t.url+path2+"?download_raw", path2, &t.noRole, 9, "", []byte("foobarbaz"))
}

func (t *TestSuite) TestStoreAndGetNodeAsAdminWithFormatAndTrailingSlashAndSeekAndGet() {
func (t *TestSuite) TestStoreAndGetNodeAsAdminWithFormatAndTrailingSlashAndSeekAndLength() {
body := t.req("POST", t.url+"/node/?format=JSON", strings.NewReader("foobarbaz"),
"oauth "+t.noRole.token, 378, 200)
t.checkLogs(logEvent{logrus.InfoLevel, "POST", "/node/", 200, ptr("noroles"),
Expand Down

0 comments on commit 5db1e52

Please sign in to comment.