Closed
Bug 805598
Opened 12 years ago
Closed 12 years ago
mozhttpd fails to serve svg files on linux and windows buildbot slaves
Categories
(Testing :: Mozbase, defect)
Testing
Mozbase
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jmaher, Unassigned)
References
Details
Attachments
(2 files)
616 bytes,
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
1.37 KB,
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
while running with --develop in production (try server) I found that tsvg failed on linux and windows builds consistently, but passed on osx. Odd, but true. In debugging locally, it passes on my local linux box but fails on a windows 7 vm that I have. When pageloader sends the http://localhost:15707/page_load_test/svg/gearflowers.svg to the browser, we get a popup to download the SVG file. Looking into this we have a header type of application/octet-stream.
Comment 1•12 years ago
|
||
Looking into this a bit, it looks like a mimetype issue. Reading the help for SimpleHTTPServer.SimpleHTTPRequestHandler which mozhttpd.RequestHandler inherits from, the mimetype is guessed from .guess_type(): """ | guess_type(self, path) | Guess the type of a file. | | Argument is a PATH (a filename). | | Return value is a string of the form type/subtype, | usable for a MIME Content-type header. | | The default implementation looks the file's extension | up in the table self.extensions_map, using application/octet-stream | as a default; however it would be permissible (if | slow) to look inside the data to make a better guess. """ Mind you, this is python 2.7 documentation. But if this is accurate, we should be able to add: '.svg': 'image/svg+xml' to self.extensions_map and this will work.
Comment 2•12 years ago
|
||
unless i made a typo or this doesn't work with ancient python, this should do it
Attachment #675289 -
Flags: review?(jmaher)
Comment 3•12 years ago
|
||
Following this: - a new version of mozhttpd should be released to pypi and probably m-c - talos should be pegged to use this version and create_talos_zip.py should be editted accordingly
Reporter | ||
Comment 4•12 years ago
|
||
Comment on attachment 675289 [details] [diff] [review] fix Review of attachment 675289 [details] [diff] [review]: ----------------------------------------------------------------- this works in local testing on windows 7. If we could add some unittests for this it would rock.
Attachment #675289 -
Flags: review?(jmaher) → review+
Comment 5•12 years ago
|
||
pushed https://github.com/mozilla/mozbase/commit/15b0117e3b0155b8a746c78923de7cdf9565cbb9
Comment 6•12 years ago
|
||
version bumped and uploaded to pypi: https://github.com/mozilla/mozbase/commit/fb639a6b2dd29befe1e7a68951fc661c66c62ba2
Comment 7•12 years ago
|
||
Attachment #675296 -
Flags: review?(jmaher)
Reporter | ||
Updated•12 years ago
|
Attachment #675296 -
Flags: review?(jmaher) → review+
Comment 8•12 years ago
|
||
pushed to talos: http://hg.mozilla.org/build/talos/rev/692dbd36130b
Comment 9•12 years ago
|
||
filed bug 805633 as a followup; closing this
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•