mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-12 17:10:55 +00:00
Symbols are returned with a content length
This commit is contained in:
parent
a4245fcf44
commit
189ad994c8
@ -120,7 +120,7 @@ class Response(aiohttp.web.Response):
|
|||||||
|
|
||||||
st = os.stat(path)
|
st = os.stat(path)
|
||||||
self.last_modified = st.st_mtime
|
self.last_modified = st.st_mtime
|
||||||
self.enable_chunked_encoding()
|
self.headers[aiohttp.hdrs.CONTENT_LENGTH] = str(st.st_size)
|
||||||
|
|
||||||
with open(path, 'rb') as fobj:
|
with open(path, 'rb') as fobj:
|
||||||
yield from self.prepare(self._request)
|
yield from self.prepare(self._request)
|
||||||
|
@ -36,6 +36,7 @@ def test_get(http_controller):
|
|||||||
response = http_controller.get('/symbols/' + urllib.parse.quote(':/symbols/firewall.svg') + '/raw')
|
response = http_controller.get('/symbols/' + urllib.parse.quote(':/symbols/firewall.svg') + '/raw')
|
||||||
assert response.status == 200
|
assert response.status == 200
|
||||||
assert response.headers['CONTENT-TYPE'] == 'image/svg+xml'
|
assert response.headers['CONTENT-TYPE'] == 'image/svg+xml'
|
||||||
|
assert response.headers['CONTENT-LENGTH'] == '9381'
|
||||||
assert '</svg>' in response.html
|
assert '</svg>' in response.html
|
||||||
|
|
||||||
# Reply by the default symbol
|
# Reply by the default symbol
|
||||||
|
Loading…
Reference in New Issue
Block a user