# WEBrick serving SVG under https

**URL:** <https://www.ruby-forum.com/t/webrick-serving-svg-under-https/187815>\
**Category:** Rails\
**Created:** [April 29, 2010, 7:38pm UTC](https://www.ruby-forum.com/t/webrick-serving-svg-under-https/187815 "2010-04-29T19:38:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@bob](https://www.ruby-forum.com/u/bob)\
**Post date:** [April 29, 2010, 7:38pm UTC](https://www.ruby-forum.com/t/webrick-serving-svg-under-https/187815/1 "2010-04-29T19:38:59Z")

</div>

I have been developing some interactive SVG running under WEBrick.  
Works fine until the site goes under SSL. At that point my Javascript  
code fails to return a document using either contentDocument, or  
getSVGDocument(). I don’t really understand the fix, but following a  
hint from a list back in 2007, everything works again when i put the  
following line in httputils.rb. On my installation that is at

/usr/lib/ruby/1.8/webrick/httputils.rb

```
  "svg" => "image/svg+xml",

```

added into the object DefaultMimeTypes.

Here is the header to httputils.rb

# 

# httputils.rb – HTTPUtils Module

# 

# Author: IPR – Internet Programming with Ruby – writers

# Copyright © 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou

# Copyright © 2002 Internet Programming with Ruby writers. All

rights

# reserved.

# 

# $IPR: httputils.rb,v 1.34 2003/06/05 21:34:08 gotoyuzo Exp $

Perhaps this will help someone out there in future.
