Web Server MIME Types

Discussion to talk about software related topics only.
Post Reply
SandCuser
Posts: 1
Joined: Thu May 09, 2013 1:05 pm

Web Server MIME Types

Post by SandCuser »

I am currently using a MOD5282 with default firmware. I am trying to run a web server that can serve SVG files up. I order to do this properly the files need to have MIME type of image/svg+xml (currently the server is marking them as text/plain).

My question is there a way to configure Netburners web server to serve up different MIME types than those provided by default? I see that the source and header files for the comphtml are probably the place to do this, but how do I change, build and program this so it works as I described above?

Thank you for your help.
User avatar
Forrest
Posts: 289
Joined: Wed Apr 23, 2008 10:05 am

Re: Web Server MIME Types

Post by Forrest »

SandCuser wrote: My question is there a way to configure Netburners web server to serve up different MIME types than those provided by default? I see that the source and header files for the comphtml are probably the place to do this, but how do I change, build and program this so it works as I described above?
Good news, you can do this without rebuilding any of our tools. Edit the file \nburn\pcbin\MIME_magic.txt. It should be self explanatory. Make your change and then clean and rebuild your project.
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: Web Server MIME Types

Post by dciliske »

Man... Can't believe I missed that one. Add the line

Code: Select all

.svg     1      image/svg+xml
to your MIME_magic.txt in pcbin. Amusingly, this is precisely why the MIME_magic file was added last year.

I've added that MIME type to the main copy of the file for future releases.

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
Post Reply