Ability to override Content-Type header for responses
Description
GCDWebServer provided the method that allows overriding the MIME types but react-native-static-server didn’t expose that capability, I added the optional mimeTypeOverrides argument to give the ability to override response’s Content-Type header.
Motivation and Context
When I tried to use this to set up our local server, it failed to set the correct Content-Type header for responses returning XML files. It sets application/octet-stream instead of application/xml as XMLHttpRequest expects.
The root cause is that GCDWebServer sets the response’s Content-Type header to application/octet-stream for all file types, except for a few well-known ones such as HTML or CSS. Therefore, I implemented a simple change as described above to set the correct Content-Type header for responses.