[Seaside-dev] Subtle but very annoying WAMimeType change

Sven Van Caekenberghe sven at stfx.eu
Sat Jun 6 19:34:37 UTC 2020


Hi,

I finally figured out a subtle but very annoying issue that I had, which comes down to a change in WAMimeType.

"pharo 7"

'application/javascript' asZnMimeType isBinary.
 "false"
'application/x-javascript' asZnMimeType isBinary.
 "false"

"older github://SeasideSt/Seaside:master/repository"
(WAMimeType main: 'application' sub: 'javascript') isBinary.
 "true"
(WAMimeType main: 'application' sub: 'x-javascript') isBinary. 
 "false"

"newer github://SeasideSt/Seaside:master/repository"
(WAMimeType main: 'application' sub: 'javascript') isBinary.
 "false"
(WAMimeType main: 'application' sub: 'x-javascript') isBinary. 
 "true"

As you can see the tests are reversed in the later Seaside (which was a diff between my development and deployment image).

This lead to a failure in serving .js files as needed for Bootstrap

I had to change/override 

jsbootstrapminJs
	^ WAFileLibraryResource
		filepath: 'js/bootstrap.min.js'
		mimeType: (WAMimeType main: 'application' sub: 'x-javascript')
		cacheDuration: (Duration days: 0 hours: 0 minutes: 30 seconds: 0)
		contents: (GRDelayedSend receiver: self selector: #jsbootstrapminJsContent)

to

jsbootstrapminJs
	^ WAFileLibraryResource
		filepath: 'js/bootstrap.min.js'
		mimeType: (WAMimeType main: 'application' sub: 'javascript')
		cacheDuration: (Duration days: 0 hours: 0 minutes: 30 seconds: 0)
		contents: (GRDelayedSend receiver: self selector: #jsbootstrapminJsContent)

Sven




More information about the seaside-dev mailing list