Repository: falconry/falcon

Issue:
Add support to Response for the Accept-Ranges header
Should be fairly straightforward (see also: https://tools.ietf.org/html/rfc7233#section-2.3)

Discussion:
codecov-io: ## [Current coverage](https://codecov.io/gh/falconry/falcon/pull/909?src=pr) is 100% (diff: 100%)
> Merging [#909](https://codecov.io/gh/falconry/falcon/pull/909?src=pr) into [master](https://codecov.io/gh/falconry/falcon/branch/master?src=pr) will not change coverage

```diff
@@           master   #909   diff @@
====================================
  Files          31     31          
  Lines        1969   1970     +1   
  Methods         0      0          
  Messages        0      0          
  Branches      320    320          
====================================
+ Hits         1969   1970     +1   
  Misses          0      0          
  Partials        0      0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [67d6102...bd67690](https://codecov.io/gh/falconry/falcon/compare/67d61029847cbf59e4053c8a424df4f9f87ad36f...bd6769013acdb0cb864dddeef8c65bac200ad089?src=pr)

Patch:
diff --git a/falcon/response.py b/falcon/response.py
index 6e73436..eabced5 100644
--- a/falcon/response.py
+++ b/falcon/response.py
@@ -625,6 +625,24 @@ class Response(object):
         """,
         lambda v: ', '.join(v))
 
+    accept_ranges = header_property(
+        'Accept-Ranges',
+        """Sets the Accept-Ranges header.
+
+        The Accept-Ranges header field indicates to the client which
+        range units are supported (e.g. "bytes") for the target
+        resource.
+
+        If range requests are not supported for the target resource,
+        the header may be set to "none" to advise the client not to
+        attempt any such requests.
+
+        Note:
+            "none" is the literal string, not Python's built-in ``None``
+            type.
+
+        """)
+
     def _encode_header(self, name, value, py2=PY2):
         if py2:
             if isinstance(name, unicode):


Test patch:
diff --git a/tests/test_headers.py b/tests/test_headers.py
index 3244f22..387690f 100644
--- a/tests/test_headers.py
+++ b/tests/test_headers.py
@@ -50,6 +50,8 @@ class HeaderHelpersResource(object):
         else:
             resp.content_range = (0, 25, 100, req.range_unit)
 
+        resp.accept_ranges = 'bytes'
+
         self.resp = resp
 
     def on_head(self, req, resp):
@@ -322,6 +324,9 @@ class TestHeaders(testing.TestCase):
         resp.content_range = (1, 499, 10 * 1024, 'bytes')
         self.assertEqual(resp.content_range, 'bytes 1-499/10240')
 
+        self.assertEqual(resp.accept_ranges, 'bytes')
+        self.assertEqual(result.headers['Accept-Ranges'], 'bytes')
+
         req_headers = {'Range': 'items=0-25'}
         result = self.simulate_get(headers=req_headers)
         self.assertEqual(result.headers['Content-Range'], 'items 0-25/100')