mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 16:54:51 +02: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)
|
||||
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:
|
||||
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')
|
||||
assert response.status == 200
|
||||
assert response.headers['CONTENT-TYPE'] == 'image/svg+xml'
|
||||
assert response.headers['CONTENT-LENGTH'] == '9381'
|
||||
assert '</svg>' in response.html
|
||||
|
||||
# Reply by the default symbol
|
||||
|
Loading…
Reference in New Issue
Block a user