Flash file (swf) git-lfs file not properly served


Flash file (swf) file not properly served on my website with GIT_LFS_ENABLED = true. Other files extention like jpg or png are fine.

Sample URL: https://signage-o2oindonesia.netlify.com/flash/clock/index.swf
Example of http response :

Adding GIT_LFS_FETCH_INCLUDE = .eot,.gif,.jpg,.pdf,.png,.svg,.woff,.swf,.wasm,*.mp4 , and swf file fetched properly.

But swf Content-Type served as “application/vnd.adobe.flash.movie” instead of “application/x-shockwave-flash”. Still not working.

Adding in _headers:

Content-Type: application/x-shockwave-flash

Make all files serve as “application/x-shockwave-flash”, not only swf files :cold_sweat:

How to properly change content-type of all swf file in Netlify ?

Hi, @dodikuswono, the * in the header rule will match everything to the end of the line. This means it is not possible to make a rule which matches a file extension (like .swf of .js) this way.

One way to get that header rule to apply is to write rules which specifically match the filename exactly. Often people will write a script to automatically create the header rules by searching for all the files that need to be matched. (This is helpful particularly when the filenames are known to change or new files are added often.)

There is another possible solution. Is it possible to restructure the site so that all .swf files are located in a single directory/path? If this is done, a wildcard rule is possible.

For example, if all the .swf files were put into ./assest/swf/ (relative to the publish directory) then the rule above could be rewritten as:

  Content-Type: application/x-shockwave-flash

​Please let us know if there are other questions about this.