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.
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.
Created attachment 675289 [details] [diff] [review] fix unless i made a typo or this doesn't work with ancient python, this should do it
Attachment #675289 - Flags: review?(jmaher)
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
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+
version bumped and uploaded to pypi: https://github.com/mozilla/mozbase/commit/fb639a6b2dd29befe1e7a68951fc661c66c62ba2
Created attachment 675296 [details] [diff] [review] fix talos to mozhttpd 0.5
Attachment #675296 - Flags: review?(jmaher)
6 years ago
Attachment #675296 - Flags: review?(jmaher) → review+
pushed to talos: http://hg.mozilla.org/build/talos/rev/692dbd36130b
filed bug 805633 as a followup; closing this
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.