[openstreetmap/openstreetmap-website] GPX Upload from Basecamp fails (#2258)

Andy Allan notifications at github.com
Fri Jun 14 12:28:12 UTC 2019


Yeah, I'd tracked it down to the Mimetype detection failing, but I was still waiting on getting the raw file to figure out what was triggering it. A byte order mark will definitely do it:

```
$ bundle exec rails console
Loading development environment (Rails 5.2.3)
irb(main):001:0> MimeMagic.by_magic(StringIO.new("<?xml>")).type
=> "application/xml"
irb(main):002:0> MimeMagic.by_magic(StringIO.new("\xEF\xBB\xBF<?xml>")).type
Traceback (most recent call last):
        1: from (irb):2
NoMethodError (undefined method `type' for nil:NilClass)
irb(main):003:0> 
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/2258#issuecomment-502090013
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190614/024f1da3/attachment.html>


More information about the rails-dev mailing list