Subtle but very annoying WAMimeType change

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Subtle but very annoying WAMimeType change

Sven Van Caekenberghe-2
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
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Subtle but very annoying WAMimeType change

Esteban A. Maringolo
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 <[hidden email]> 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
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Subtle but very annoying WAMimeType change

Johan Brichau-2
In reply to this post by Sven Van Caekenberghe-2
Hey Sven,

We can correct that. Although ‘application/x-javascript’ should not be used actually (see http://www.rfc-editor.org/rfc/rfc4329.txt)
Can you send it in as an issue on GitHub so I don’t forget?

Thx!

Johan

On 6 Jun 2020, at 21:34, Sven Van Caekenberghe <[hidden email]> 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 <a href="github://SeasideSt/Seaside:master/repository" class="">github://SeasideSt/Seaside:master/repository"
(WAMimeType main: 'application' sub: 'javascript') isBinary.
"true"
(WAMimeType main: 'application' sub: 'x-javascript') isBinary.
"false"

"newer <a href="github://SeasideSt/Seaside:master/repository" class="">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
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev


_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Subtle but very annoying WAMimeType change

Sven Van Caekenberghe-2
Johan,

I did not yet look in the repository to figure out what happened.

I think that your commit

https://github.com/SeasideSt/Seaside/commit/78d465878c7ce2839e368efecb4d615b6c6fb005#diff-1a9680844bf1a1cae49e853111e97092

is the one that introduced the change.

I agree that application/x-javascript should be replaced by application/javascript, but in the process you made the old one binary, that seems like a mistake.

I will make an issue.

Sven

> On 7 Jun 2020, at 13:09, Johan Brichau <[hidden email]> wrote:
>
> Hey Sven,
>
> We can correct that. Although ‘application/x-javascript’ should not be used actually (see http://www.rfc-editor.org/rfc/rfc4329.txt)
> Can you send it in as an issue on GitHub so I don’t forget?
>
> Thx!
>
> Johan
>
>> On 6 Jun 2020, at 21:34, Sven Van Caekenberghe <[hidden email]> 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
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>
> _______________________________________________
> seaside-dev mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev

_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Subtle but very annoying WAMimeType change

Sven Van Caekenberghe-2
https://github.com/SeasideSt/Seaside/issues/1203

> On 7 Jun 2020, at 13:30, Sven Van Caekenberghe <[hidden email]> wrote:
>
> Johan,
>
> I did not yet look in the repository to figure out what happened.
>
> I think that your commit
>
> https://github.com/SeasideSt/Seaside/commit/78d465878c7ce2839e368efecb4d615b6c6fb005#diff-1a9680844bf1a1cae49e853111e97092
>
> is the one that introduced the change.
>
> I agree that application/x-javascript should be replaced by application/javascript, but in the process you made the old one binary, that seems like a mistake.
>
> I will make an issue.
>
> Sven
>
>> On 7 Jun 2020, at 13:09, Johan Brichau <[hidden email]> wrote:
>>
>> Hey Sven,
>>
>> We can correct that. Although ‘application/x-javascript’ should not be used actually (see http://www.rfc-editor.org/rfc/rfc4329.txt)
>> Can you send it in as an issue on GitHub so I don’t forget?
>>
>> Thx!
>>
>> Johan
>>
>>> On 6 Jun 2020, at 21:34, Sven Van Caekenberghe <[hidden email]> 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
>>> [hidden email]
>>> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>>
>> _______________________________________________
>> seaside-dev mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>

_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev