Skip to content

Commit

Permalink
TritonDataCenter#30 HEAD request should return an Accept-Ranges header
Browse files Browse the repository at this point in the history
  • Loading branch information
arekinath committed Nov 1, 2019
1 parent 4ed2417 commit e5ff7c4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ function streamFromSharks(req, res, next) {
res.header('Content-Length', md.contentLength);
res.header('Content-MD5', md.contentMD5);
res.header('Content-Type', md.contentType);
res.header('Accept-Ranges', 'bytes');
res.send(200);
next();
return;
Expand Down
15 changes: 15 additions & 0 deletions test/obj.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,21 @@ test('get ok', function (t) {
});


test('head ok', function (t) {
var self = this;
this.putObject(t, function () {
self.client.head(self.key, function (err, stream, res) {
t.ifError(err);
t.equal(res.headers['content-type'], 'text/plain');
t.ok(res.headers.etag);
t.ok(res.headers['last-modified']);
t.equal('bytes', res.headers['accept-ranges']);
t.end();
});
});
});


test('get 404', function (t) {
this.client.get(this.key + 'a', function (err, stream, res) {
t.ok(err);
Expand Down

0 comments on commit e5ff7c4

Please sign in to comment.