[Seaside-dev] Subtle but very annoying WAMimeType change

Esteban Maringolo emaringolo at gmail.com
Sat Jun 6 20:23:21 UTC 2020


It's funny you just found that, a moment ago I was working with a
WARestfulFilter and defined a route as producing 'application/json'
and got an error because it tried to set the output stream as binary,
because it treats everything that is 'application/*' as binary.

This isn't Pharo, but VW.

Regards,

Esteban A. Maringolo

On Sat, Jun 6, 2020 at 4:34 PM Sven Van Caekenberghe <sven at stfx.eu> wrote:
>
> 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
>
>
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev


More information about the seaside-dev mailing list