You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2019/03/19 17:37:04 UTC

[royale-asjs] branch develop updated: amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce access denied (401) errors that can generate messages without headers, but we still want Royale executes its faulhandler

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9efd0d4  amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce access denied (401) errors that can generate messages without headers, but we still want Royale executes its faulhandler
9efd0d4 is described below

commit 9efd0d41ef153025d20447362ec1b66c1889303c
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Tue Mar 19 18:36:56 2019 +0100

    amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce access denied (401) errors that can generate messages without headers, but we still want Royale executes its faulhandler
---
 .../MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
index 8803f6b..3938a04 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
@@ -542,11 +542,11 @@ public class AMFChannel extends NetConnectionChannel
                 _log.debug("'{0}' fault handler called. {1}", id, msg.toString());
 
                 // Set the server assigned RoyaleClient Id.
-                if (RoyaleClient.getInstance().id == null && msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
+                if (RoyaleClient.getInstance().id == null && msg.headers != undefined && msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
                     RoyaleClient.getInstance().id = msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER];
 
                 // Process the features advertised by the server endpoint.
-                if (msg.headers[CommandMessage.MESSAGING_VERSION] != null)
+                if (msg.headers != undefined && msg.headers[CommandMessage.MESSAGING_VERSION] != null)
                 {
                     var serverVersion:Number = msg.headers[CommandMessage.MESSAGING_VERSION] as Number;
                     handleServerMessagingVersion(serverVersion);


Re: [royale-asjs] branch develop updated: amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce ...

Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex,

I'm sorry to say that with != null now my app fails silently without report
any error. The first attempt to login don't do nothing
Reverting back to != undefined works. So I think there's some bug that's
affecting this. I switch back again until we found a solution

El mié., 20 mar. 2019 a las 19:33, Carlos Rovira (<ca...@apache.org>)
escribió:

> Hi Alex,
>
> thanks for explaining, I thought that was different. I'll change to != null
>
>
> El mié., 20 mar. 2019 a las 18:57, Alex Harui (<ah...@adobe.com.invalid>)
> escribió:
>
>> Hi Carlos,
>>
>> AIUI, both AS on Flash and JS in the browser handle "!=" (and not "!==")
>> the same, which is that whether an property is undefined or null, the "!="
>> test will return true.  The advantage of "!=" is that in Flash (and maybe
>> future browser runtimes or other runtimes) all properties that are defined
>> to have a value (of null in Flash), so this single test works without
>> having to resort to use ["propName"] to work around the fact that only '*'
>> types can have undefined as a value.
>>
>> I would expect there are lots of tests for "!= null" in the Royale
>> framework code and fewer places were folks test against "undefined".
>>
>> My 2 cents,
>> -Alex
>>
>> On 3/20/19, 10:43 AM, "Carlos Rovira" <ca...@apache.org> wrote:
>>
>>     Hi Alex,
>>
>>     the problem is that msg is an Object and headers is not coming so is
>>     undefined, not null, and the property doesn't exits.
>>     So if I understand right the right way would be to check !=
>> undefined. If
>>     in this scenario I could change for != null I can do it, but I tough
>> is not
>>     valid
>>
>>
>>     El mié., 20 mar. 2019 a las 16:37, Alex Harui
>> (<ah...@adobe.com.invalid>)
>>     escribió:
>>
>>     > Hi Carlos,
>>     >
>>     > I  guess that’s ok, but I expected you would just test for “!=
>> null”.  Is
>>     > null an allowed value with a different meaning than undefined?
>>     >
>>     > -Alex
>>     >
>>     > From: Carlos Rovira <ca...@apache.org>
>>     > Date: Wednesday, March 20, 2019 at 2:44 AM
>>     > To: "dev@royale.apache.org" <de...@royale.apache.org>, Alex Harui <
>>     > aharui@adobe.com>
>>     > Subject: Re: [royale-asjs] branch develop updated: amfchannel:
>> ensure
>>     > headers are not undefined, this is needed in shared enviroments
>> when the
>>     > application can be hosted in a domain but served through other
>> domain. In
>>     > this cases interacting with AMF can produce ...
>>     >
>>     > Hi Alex, you're right. I committed a different notation that removes
>>     > warnings. Let me know if is ok for you.
>>     > thanks
>>     >
>>     > El mié., 20 mar. 2019 a las 1:49, Alex Harui
>> (<ah...@adobe.com.invalid>)
>>     > escribió:
>>     > Carlos,
>>     >
>>     > This change is causing warnings.  Are you not getting the same
>> warnings?
>>     >
>>     > -Alex
>>     >
>>     >
>> frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(549):
>>     > col: 21 Illogical comparison with undefined.  Only untyped
>> variables (or
>>     > variables of type *) can be undefined.
>>     >
>>     >
>> frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(545):
>>     > col: 62 Illogical comparison with undefined.  Only untyped
>> variables (or
>>     > variables of type *) can be undefined.
>>     >
>>     > On 3/19/19, 10:37 AM, "carlosrovira@apache.org<mailto:
>>     > carlosrovira@apache.org>" <carlosrovira@apache.org<mailto:
>>     > carlosrovira@apache.org>> wrote:
>>     >
>>     >     This is an automated email from the ASF dual-hosted git
>> repository.
>>     >
>>     >     carlosrovira pushed a commit to branch develop
>>     >     in repository
>>     >
>> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=%2FCN8kEawGX0xcemd%2BQzrTgj6UOSVfzQ8E7%2F%2BAHAL%2B9M%3D&amp;reserved=0
>>     > <
>>     >
>> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=%2FCN8kEawGX0xcemd%2BQzrTgj6UOSVfzQ8E7%2F%2BAHAL%2B9M%3D&amp;reserved=0
>>     > >
>>     >
>>     >
>>     >     The following commit(s) were added to refs/heads/develop by
>> this push:
>>     >          new 9efd0d4  amfchannel: ensure headers are not undefined,
>> this
>>     > is needed in shared enviroments when the application can be hosted
>> in a
>>     > domain but served through other domain. In this cases interacting
>> with AMF
>>     > can produce access denied (401) errors that can generate messages
>> without
>>     > headers, but we still want Royale executes its faulhandler
>>     >     9efd0d4 is described below
>>     >
>>     >     commit 9efd0d41ef153025d20447362ec1b66c1889303c
>>     >     Author: Carlos Rovira <carlosrovira@apache.org<mailto:
>>     > carlosrovira@apache.org>>
>>     >     AuthorDate: Tue Mar 19 18:36:56 2019 +0100
>>     >
>>     >         amfchannel: ensure headers are not undefined, this is
>> needed in
>>     > shared enviroments when the application can be hosted in a domain
>> but
>>     > served through other domain. In this cases interacting with AMF can
>> produce
>>     > access denied (401) errors that can generate messages without
>> headers, but
>>     > we still want Royale executes its faulhandler
>>     >     ---
>>     >
>> .../MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>>     > | 4 ++--
>>     >      1 file changed, 2 insertions(+), 2 deletions(-)
>>     >
>>     >     diff --git
>>     >
>> a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>>     >
>> b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>>     >     index 8803f6b..3938a04 100644
>>     >     ---
>>     >
>> a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>>     >     +++
>>     >
>> b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>>     >     @@ -542,11 +542,11 @@ public class AMFChannel extends
>>     > NetConnectionChannel
>>     >                      _log.debug("'{0}' fault handler called. {1}",
>> id,
>>     > msg.toString());
>>     >
>>     >                      // Set the server assigned RoyaleClient Id.
>>     >     -                if (RoyaleClient.getInstance().id == null &&
>>     > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
>>     >     +                if (RoyaleClient.getInstance().id == null &&
>>     > msg.headers != undefined &&
>>     > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
>>     >                          RoyaleClient.getInstance().id =
>>     > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER];
>>     >
>>     >                      // Process the features advertised by the
>> server
>>     > endpoint.
>>     >     -                if
>> (msg.headers[CommandMessage.MESSAGING_VERSION] !=
>>     > null)
>>     >     +                if (msg.headers != undefined &&
>>     > msg.headers[CommandMessage.MESSAGING_VERSION] != null)
>>     >                      {
>>     >                          var serverVersion:Number =
>>     > msg.headers[CommandMessage.MESSAGING_VERSION] as Number;
>>     >
>> handleServerMessagingVersion(serverVersion);
>>     >
>>     >
>>     >
>>     >
>>     > --
>>     > Carlos Rovira
>>     >
>> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=kGjJwZebC%2F6LqO%2FqRmhKQTEePxrwPiDsNrvPUWK1Rrs%3D&amp;reserved=0
>> <
>>     >
>> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=kGjJwZebC%2F6LqO%2FqRmhKQTEePxrwPiDsNrvPUWK1Rrs%3D&amp;reserved=0
>>     > >
>>     >
>>     >
>>
>>     --
>>     Carlos Rovira
>>
>> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=kGjJwZebC%2F6LqO%2FqRmhKQTEePxrwPiDsNrvPUWK1Rrs%3D&amp;reserved=0
>>
>>
>>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce ...

Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex,

thanks for explaining, I thought that was different. I'll change to != null


El mié., 20 mar. 2019 a las 18:57, Alex Harui (<ah...@adobe.com.invalid>)
escribió:

> Hi Carlos,
>
> AIUI, both AS on Flash and JS in the browser handle "!=" (and not "!==")
> the same, which is that whether an property is undefined or null, the "!="
> test will return true.  The advantage of "!=" is that in Flash (and maybe
> future browser runtimes or other runtimes) all properties that are defined
> to have a value (of null in Flash), so this single test works without
> having to resort to use ["propName"] to work around the fact that only '*'
> types can have undefined as a value.
>
> I would expect there are lots of tests for "!= null" in the Royale
> framework code and fewer places were folks test against "undefined".
>
> My 2 cents,
> -Alex
>
> On 3/20/19, 10:43 AM, "Carlos Rovira" <ca...@apache.org> wrote:
>
>     Hi Alex,
>
>     the problem is that msg is an Object and headers is not coming so is
>     undefined, not null, and the property doesn't exits.
>     So if I understand right the right way would be to check != undefined.
> If
>     in this scenario I could change for != null I can do it, but I tough
> is not
>     valid
>
>
>     El mié., 20 mar. 2019 a las 16:37, Alex Harui
> (<ah...@adobe.com.invalid>)
>     escribió:
>
>     > Hi Carlos,
>     >
>     > I  guess that’s ok, but I expected you would just test for “!=
> null”.  Is
>     > null an allowed value with a different meaning than undefined?
>     >
>     > -Alex
>     >
>     > From: Carlos Rovira <ca...@apache.org>
>     > Date: Wednesday, March 20, 2019 at 2:44 AM
>     > To: "dev@royale.apache.org" <de...@royale.apache.org>, Alex Harui <
>     > aharui@adobe.com>
>     > Subject: Re: [royale-asjs] branch develop updated: amfchannel: ensure
>     > headers are not undefined, this is needed in shared enviroments when
> the
>     > application can be hosted in a domain but served through other
> domain. In
>     > this cases interacting with AMF can produce ...
>     >
>     > Hi Alex, you're right. I committed a different notation that removes
>     > warnings. Let me know if is ok for you.
>     > thanks
>     >
>     > El mié., 20 mar. 2019 a las 1:49, Alex Harui
> (<ah...@adobe.com.invalid>)
>     > escribió:
>     > Carlos,
>     >
>     > This change is causing warnings.  Are you not getting the same
> warnings?
>     >
>     > -Alex
>     >
>     >
> frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(549):
>     > col: 21 Illogical comparison with undefined.  Only untyped variables
> (or
>     > variables of type *) can be undefined.
>     >
>     >
> frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(545):
>     > col: 62 Illogical comparison with undefined.  Only untyped variables
> (or
>     > variables of type *) can be undefined.
>     >
>     > On 3/19/19, 10:37 AM, "carlosrovira@apache.org<mailto:
>     > carlosrovira@apache.org>" <carlosrovira@apache.org<mailto:
>     > carlosrovira@apache.org>> wrote:
>     >
>     >     This is an automated email from the ASF dual-hosted git
> repository.
>     >
>     >     carlosrovira pushed a commit to branch develop
>     >     in repository
>     >
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=%2FCN8kEawGX0xcemd%2BQzrTgj6UOSVfzQ8E7%2F%2BAHAL%2B9M%3D&amp;reserved=0
>     > <
>     >
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=%2FCN8kEawGX0xcemd%2BQzrTgj6UOSVfzQ8E7%2F%2BAHAL%2B9M%3D&amp;reserved=0
>     > >
>     >
>     >
>     >     The following commit(s) were added to refs/heads/develop by this
> push:
>     >          new 9efd0d4  amfchannel: ensure headers are not undefined,
> this
>     > is needed in shared enviroments when the application can be hosted
> in a
>     > domain but served through other domain. In this cases interacting
> with AMF
>     > can produce access denied (401) errors that can generate messages
> without
>     > headers, but we still want Royale executes its faulhandler
>     >     9efd0d4 is described below
>     >
>     >     commit 9efd0d41ef153025d20447362ec1b66c1889303c
>     >     Author: Carlos Rovira <carlosrovira@apache.org<mailto:
>     > carlosrovira@apache.org>>
>     >     AuthorDate: Tue Mar 19 18:36:56 2019 +0100
>     >
>     >         amfchannel: ensure headers are not undefined, this is needed
> in
>     > shared enviroments when the application can be hosted in a domain but
>     > served through other domain. In this cases interacting with AMF can
> produce
>     > access denied (401) errors that can generate messages without
> headers, but
>     > we still want Royale executes its faulhandler
>     >     ---
>     >      .../MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     > | 4 ++--
>     >      1 file changed, 2 insertions(+), 2 deletions(-)
>     >
>     >     diff --git
>     >
> a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     >
> b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     >     index 8803f6b..3938a04 100644
>     >     ---
>     >
> a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     >     +++
>     >
> b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     >     @@ -542,11 +542,11 @@ public class AMFChannel extends
>     > NetConnectionChannel
>     >                      _log.debug("'{0}' fault handler called. {1}",
> id,
>     > msg.toString());
>     >
>     >                      // Set the server assigned RoyaleClient Id.
>     >     -                if (RoyaleClient.getInstance().id == null &&
>     > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
>     >     +                if (RoyaleClient.getInstance().id == null &&
>     > msg.headers != undefined &&
>     > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
>     >                          RoyaleClient.getInstance().id =
>     > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER];
>     >
>     >                      // Process the features advertised by the server
>     > endpoint.
>     >     -                if
> (msg.headers[CommandMessage.MESSAGING_VERSION] !=
>     > null)
>     >     +                if (msg.headers != undefined &&
>     > msg.headers[CommandMessage.MESSAGING_VERSION] != null)
>     >                      {
>     >                          var serverVersion:Number =
>     > msg.headers[CommandMessage.MESSAGING_VERSION] as Number;
>     >                          handleServerMessagingVersion(serverVersion);
>     >
>     >
>     >
>     >
>     > --
>     > Carlos Rovira
>     >
> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=kGjJwZebC%2F6LqO%2FqRmhKQTEePxrwPiDsNrvPUWK1Rrs%3D&amp;reserved=0
> <
>     >
> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=kGjJwZebC%2F6LqO%2FqRmhKQTEePxrwPiDsNrvPUWK1Rrs%3D&amp;reserved=0
>     > >
>     >
>     >
>
>     --
>     Carlos Rovira
>
> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=kGjJwZebC%2F6LqO%2FqRmhKQTEePxrwPiDsNrvPUWK1Rrs%3D&amp;reserved=0
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce ...

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Carlos,

AIUI, both AS on Flash and JS in the browser handle "!=" (and not "!==") the same, which is that whether an property is undefined or null, the "!=" test will return true.  The advantage of "!=" is that in Flash (and maybe future browser runtimes or other runtimes) all properties that are defined to have a value (of null in Flash), so this single test works without having to resort to use ["propName"] to work around the fact that only '*' types can have undefined as a value.

I would expect there are lots of tests for "!= null" in the Royale framework code and fewer places were folks test against "undefined".

My 2 cents,
-Alex

On 3/20/19, 10:43 AM, "Carlos Rovira" <ca...@apache.org> wrote:

    Hi Alex,
    
    the problem is that msg is an Object and headers is not coming so is
    undefined, not null, and the property doesn't exits.
    So if I understand right the right way would be to check != undefined. If
    in this scenario I could change for != null I can do it, but I tough is not
    valid
    
    
    El mié., 20 mar. 2019 a las 16:37, Alex Harui (<ah...@adobe.com.invalid>)
    escribió:
    
    > Hi Carlos,
    >
    > I  guess that’s ok, but I expected you would just test for “!= null”.  Is
    > null an allowed value with a different meaning than undefined?
    >
    > -Alex
    >
    > From: Carlos Rovira <ca...@apache.org>
    > Date: Wednesday, March 20, 2019 at 2:44 AM
    > To: "dev@royale.apache.org" <de...@royale.apache.org>, Alex Harui <
    > aharui@adobe.com>
    > Subject: Re: [royale-asjs] branch develop updated: amfchannel: ensure
    > headers are not undefined, this is needed in shared enviroments when the
    > application can be hosted in a domain but served through other domain. In
    > this cases interacting with AMF can produce ...
    >
    > Hi Alex, you're right. I committed a different notation that removes
    > warnings. Let me know if is ok for you.
    > thanks
    >
    > El mié., 20 mar. 2019 a las 1:49, Alex Harui (<ah...@adobe.com.invalid>)
    > escribió:
    > Carlos,
    >
    > This change is causing warnings.  Are you not getting the same warnings?
    >
    > -Alex
    >
    > frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(549):
    > col: 21 Illogical comparison with undefined.  Only untyped variables (or
    > variables of type *) can be undefined.
    >
    > frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(545):
    > col: 62 Illogical comparison with undefined.  Only untyped variables (or
    > variables of type *) can be undefined.
    >
    > On 3/19/19, 10:37 AM, "carlosrovira@apache.org<mailto:
    > carlosrovira@apache.org>" <carlosrovira@apache.org<mailto:
    > carlosrovira@apache.org>> wrote:
    >
    >     This is an automated email from the ASF dual-hosted git repository.
    >
    >     carlosrovira pushed a commit to branch develop
    >     in repository
    > https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=%2FCN8kEawGX0xcemd%2BQzrTgj6UOSVfzQ8E7%2F%2BAHAL%2B9M%3D&amp;reserved=0
    > <
    > https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=%2FCN8kEawGX0xcemd%2BQzrTgj6UOSVfzQ8E7%2F%2BAHAL%2B9M%3D&amp;reserved=0
    > >
    >
    >
    >     The following commit(s) were added to refs/heads/develop by this push:
    >          new 9efd0d4  amfchannel: ensure headers are not undefined, this
    > is needed in shared enviroments when the application can be hosted in a
    > domain but served through other domain. In this cases interacting with AMF
    > can produce access denied (401) errors that can generate messages without
    > headers, but we still want Royale executes its faulhandler
    >     9efd0d4 is described below
    >
    >     commit 9efd0d41ef153025d20447362ec1b66c1889303c
    >     Author: Carlos Rovira <carlosrovira@apache.org<mailto:
    > carlosrovira@apache.org>>
    >     AuthorDate: Tue Mar 19 18:36:56 2019 +0100
    >
    >         amfchannel: ensure headers are not undefined, this is needed in
    > shared enviroments when the application can be hosted in a domain but
    > served through other domain. In this cases interacting with AMF can produce
    > access denied (401) errors that can generate messages without headers, but
    > we still want Royale executes its faulhandler
    >     ---
    >      .../MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    > | 4 ++--
    >      1 file changed, 2 insertions(+), 2 deletions(-)
    >
    >     diff --git
    > a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    > b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    >     index 8803f6b..3938a04 100644
    >     ---
    > a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    >     +++
    > b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    >     @@ -542,11 +542,11 @@ public class AMFChannel extends
    > NetConnectionChannel
    >                      _log.debug("'{0}' fault handler called. {1}", id,
    > msg.toString());
    >
    >                      // Set the server assigned RoyaleClient Id.
    >     -                if (RoyaleClient.getInstance().id == null &&
    > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
    >     +                if (RoyaleClient.getInstance().id == null &&
    > msg.headers != undefined &&
    > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
    >                          RoyaleClient.getInstance().id =
    > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER];
    >
    >                      // Process the features advertised by the server
    > endpoint.
    >     -                if (msg.headers[CommandMessage.MESSAGING_VERSION] !=
    > null)
    >     +                if (msg.headers != undefined &&
    > msg.headers[CommandMessage.MESSAGING_VERSION] != null)
    >                      {
    >                          var serverVersion:Number =
    > msg.headers[CommandMessage.MESSAGING_VERSION] as Number;
    >                          handleServerMessagingVersion(serverVersion);
    >
    >
    >
    >
    > --
    > Carlos Rovira
    > https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=kGjJwZebC%2F6LqO%2FqRmhKQTEePxrwPiDsNrvPUWK1Rrs%3D&amp;reserved=0<
    > https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=kGjJwZebC%2F6LqO%2FqRmhKQTEePxrwPiDsNrvPUWK1Rrs%3D&amp;reserved=0
    > >
    >
    >
    
    -- 
    Carlos Rovira
    https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C664fa82003604b7381ef08d6ad5b8967%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636887005995756156&amp;sdata=kGjJwZebC%2F6LqO%2FqRmhKQTEePxrwPiDsNrvPUWK1Rrs%3D&amp;reserved=0
    


Re: [royale-asjs] branch develop updated: amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce ...

Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex,

the problem is that msg is an Object and headers is not coming so is
undefined, not null, and the property doesn't exits.
So if I understand right the right way would be to check != undefined. If
in this scenario I could change for != null I can do it, but I tough is not
valid


El mié., 20 mar. 2019 a las 16:37, Alex Harui (<ah...@adobe.com.invalid>)
escribió:

> Hi Carlos,
>
> I  guess that’s ok, but I expected you would just test for “!= null”.  Is
> null an allowed value with a different meaning than undefined?
>
> -Alex
>
> From: Carlos Rovira <ca...@apache.org>
> Date: Wednesday, March 20, 2019 at 2:44 AM
> To: "dev@royale.apache.org" <de...@royale.apache.org>, Alex Harui <
> aharui@adobe.com>
> Subject: Re: [royale-asjs] branch develop updated: amfchannel: ensure
> headers are not undefined, this is needed in shared enviroments when the
> application can be hosted in a domain but served through other domain. In
> this cases interacting with AMF can produce ...
>
> Hi Alex, you're right. I committed a different notation that removes
> warnings. Let me know if is ok for you.
> thanks
>
> El mié., 20 mar. 2019 a las 1:49, Alex Harui (<ah...@adobe.com.invalid>)
> escribió:
> Carlos,
>
> This change is causing warnings.  Are you not getting the same warnings?
>
> -Alex
>
> frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(549):
> col: 21 Illogical comparison with undefined.  Only untyped variables (or
> variables of type *) can be undefined.
>
> frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(545):
> col: 62 Illogical comparison with undefined.  Only untyped variables (or
> variables of type *) can be undefined.
>
> On 3/19/19, 10:37 AM, "carlosrovira@apache.org<mailto:
> carlosrovira@apache.org>" <carlosrovira@apache.org<mailto:
> carlosrovira@apache.org>> wrote:
>
>     This is an automated email from the ASF dual-hosted git repository.
>
>     carlosrovira pushed a commit to branch develop
>     in repository
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C35235ceb47444d6a133008d6ac918194%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886138274728662&amp;sdata=vGYTijIVYA28CqdBGvQ4cOMUn2TKbfbQi%2BkIqvtchkY%3D&amp;reserved=0
> <
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7Caharui%40adobe.com%7Cadd106c33ad74affbc2308d6ad18a0de%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886718648991008&sdata=cXaRL%2BL8ZAZZ2P1D7%2FOoND7qKBmZifZEoSqfkTnbCk8%3D&reserved=0
> >
>
>
>     The following commit(s) were added to refs/heads/develop by this push:
>          new 9efd0d4  amfchannel: ensure headers are not undefined, this
> is needed in shared enviroments when the application can be hosted in a
> domain but served through other domain. In this cases interacting with AMF
> can produce access denied (401) errors that can generate messages without
> headers, but we still want Royale executes its faulhandler
>     9efd0d4 is described below
>
>     commit 9efd0d41ef153025d20447362ec1b66c1889303c
>     Author: Carlos Rovira <carlosrovira@apache.org<mailto:
> carlosrovira@apache.org>>
>     AuthorDate: Tue Mar 19 18:36:56 2019 +0100
>
>         amfchannel: ensure headers are not undefined, this is needed in
> shared enviroments when the application can be hosted in a domain but
> served through other domain. In this cases interacting with AMF can produce
> access denied (401) errors that can generate messages without headers, but
> we still want Royale executes its faulhandler
>     ---
>      .../MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
> | 4 ++--
>      1 file changed, 2 insertions(+), 2 deletions(-)
>
>     diff --git
> a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
> b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     index 8803f6b..3938a04 100644
>     ---
> a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     +++
> b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     @@ -542,11 +542,11 @@ public class AMFChannel extends
> NetConnectionChannel
>                      _log.debug("'{0}' fault handler called. {1}", id,
> msg.toString());
>
>                      // Set the server assigned RoyaleClient Id.
>     -                if (RoyaleClient.getInstance().id == null &&
> msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
>     +                if (RoyaleClient.getInstance().id == null &&
> msg.headers != undefined &&
> msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
>                          RoyaleClient.getInstance().id =
> msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER];
>
>                      // Process the features advertised by the server
> endpoint.
>     -                if (msg.headers[CommandMessage.MESSAGING_VERSION] !=
> null)
>     +                if (msg.headers != undefined &&
> msg.headers[CommandMessage.MESSAGING_VERSION] != null)
>                      {
>                          var serverVersion:Number =
> msg.headers[CommandMessage.MESSAGING_VERSION] as Number;
>                          handleServerMessagingVersion(serverVersion);
>
>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira<
> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7Cadd106c33ad74affbc2308d6ad18a0de%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886718649001017&sdata=WAL6rkfjyGpUf4czpq56vccaP%2FRXPDy0ewMJALYCuRg%3D&reserved=0
> >
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce ...

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Carlos,

I  guess that’s ok, but I expected you would just test for “!= null”.  Is null an allowed value with a different meaning than undefined?

-Alex

From: Carlos Rovira <ca...@apache.org>
Date: Wednesday, March 20, 2019 at 2:44 AM
To: "dev@royale.apache.org" <de...@royale.apache.org>, Alex Harui <ah...@adobe.com>
Subject: Re: [royale-asjs] branch develop updated: amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce ...

Hi Alex, you're right. I committed a different notation that removes warnings. Let me know if is ok for you.
thanks

El mié., 20 mar. 2019 a las 1:49, Alex Harui (<ah...@adobe.com.invalid>) escribió:
Carlos,

This change is causing warnings.  Are you not getting the same warnings?

-Alex

frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(549): col: 21 Illogical comparison with undefined.  Only untyped variables (or variables of type *) can be undefined.

frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(545): col: 62 Illogical comparison with undefined.  Only untyped variables (or variables of type *) can be undefined.

On 3/19/19, 10:37 AM, "carlosrovira@apache.org<ma...@apache.org>" <ca...@apache.org>> wrote:

    This is an automated email from the ASF dual-hosted git repository.

    carlosrovira pushed a commit to branch develop
    in repository https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C35235ceb47444d6a133008d6ac918194%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886138274728662&amp;sdata=vGYTijIVYA28CqdBGvQ4cOMUn2TKbfbQi%2BkIqvtchkY%3D&amp;reserved=0<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7Caharui%40adobe.com%7Cadd106c33ad74affbc2308d6ad18a0de%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886718648991008&sdata=cXaRL%2BL8ZAZZ2P1D7%2FOoND7qKBmZifZEoSqfkTnbCk8%3D&reserved=0>


    The following commit(s) were added to refs/heads/develop by this push:
         new 9efd0d4  amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce access denied (401) errors that can generate messages without headers, but we still want Royale executes its faulhandler
    9efd0d4 is described below

    commit 9efd0d41ef153025d20447362ec1b66c1889303c
    Author: Carlos Rovira <ca...@apache.org>>
    AuthorDate: Tue Mar 19 18:36:56 2019 +0100

        amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce access denied (401) errors that can generate messages without headers, but we still want Royale executes its faulhandler
    ---
     .../MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as      | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    index 8803f6b..3938a04 100644
    --- a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    @@ -542,11 +542,11 @@ public class AMFChannel extends NetConnectionChannel
                     _log.debug("'{0}' fault handler called. {1}", id, msg.toString());

                     // Set the server assigned RoyaleClient Id.
    -                if (RoyaleClient.getInstance().id == null && msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
    +                if (RoyaleClient.getInstance().id == null && msg.headers != undefined && msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
                         RoyaleClient.getInstance().id = msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER];

                     // Process the features advertised by the server endpoint.
    -                if (msg.headers[CommandMessage.MESSAGING_VERSION] != null)
    +                if (msg.headers != undefined && msg.headers[CommandMessage.MESSAGING_VERSION] != null)
                     {
                         var serverVersion:Number = msg.headers[CommandMessage.MESSAGING_VERSION] as Number;
                         handleServerMessagingVersion(serverVersion);




--
Carlos Rovira
http://about.me/carlosrovira<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7Cadd106c33ad74affbc2308d6ad18a0de%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886718649001017&sdata=WAL6rkfjyGpUf4czpq56vccaP%2FRXPDy0ewMJALYCuRg%3D&reserved=0>


Re: [royale-asjs] branch develop updated: amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce ...

Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex, you're right. I committed a different notation that removes
warnings. Let me know if is ok for you.
thanks

El mié., 20 mar. 2019 a las 1:49, Alex Harui (<ah...@adobe.com.invalid>)
escribió:

> Carlos,
>
> This change is causing warnings.  Are you not getting the same warnings?
>
> -Alex
>
> frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(549):
> col: 21 Illogical comparison with undefined.  Only untyped variables (or
> variables of type *) can be undefined.
>
> frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(545):
> col: 62 Illogical comparison with undefined.  Only untyped variables (or
> variables of type *) can be undefined.
>
> On 3/19/19, 10:37 AM, "carlosrovira@apache.org" <ca...@apache.org>
> wrote:
>
>     This is an automated email from the ASF dual-hosted git repository.
>
>     carlosrovira pushed a commit to branch develop
>     in repository
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C35235ceb47444d6a133008d6ac918194%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886138274728662&amp;sdata=vGYTijIVYA28CqdBGvQ4cOMUn2TKbfbQi%2BkIqvtchkY%3D&amp;reserved=0
>
>
>     The following commit(s) were added to refs/heads/develop by this push:
>          new 9efd0d4  amfchannel: ensure headers are not undefined, this
> is needed in shared enviroments when the application can be hosted in a
> domain but served through other domain. In this cases interacting with AMF
> can produce access denied (401) errors that can generate messages without
> headers, but we still want Royale executes its faulhandler
>     9efd0d4 is described below
>
>     commit 9efd0d41ef153025d20447362ec1b66c1889303c
>     Author: Carlos Rovira <ca...@apache.org>
>     AuthorDate: Tue Mar 19 18:36:56 2019 +0100
>
>         amfchannel: ensure headers are not undefined, this is needed in
> shared enviroments when the application can be hosted in a domain but
> served through other domain. In this cases interacting with AMF can produce
> access denied (401) errors that can generate messages without headers, but
> we still want Royale executes its faulhandler
>     ---
>      .../MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
> | 4 ++--
>      1 file changed, 2 insertions(+), 2 deletions(-)
>
>     diff --git
> a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
> b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     index 8803f6b..3938a04 100644
>     ---
> a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     +++
> b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
>     @@ -542,11 +542,11 @@ public class AMFChannel extends
> NetConnectionChannel
>                      _log.debug("'{0}' fault handler called. {1}", id,
> msg.toString());
>
>                      // Set the server assigned RoyaleClient Id.
>     -                if (RoyaleClient.getInstance().id == null &&
> msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
>     +                if (RoyaleClient.getInstance().id == null &&
> msg.headers != undefined &&
> msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
>                          RoyaleClient.getInstance().id =
> msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER];
>
>                      // Process the features advertised by the server
> endpoint.
>     -                if (msg.headers[CommandMessage.MESSAGING_VERSION] !=
> null)
>     +                if (msg.headers != undefined &&
> msg.headers[CommandMessage.MESSAGING_VERSION] != null)
>                      {
>                          var serverVersion:Number =
> msg.headers[CommandMessage.MESSAGING_VERSION] as Number;
>                          handleServerMessagingVersion(serverVersion);
>
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce ...

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Carlos,

This change is causing warnings.  Are you not getting the same warnings?

-Alex

frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(549): col: 21 Illogical comparison with undefined.  Only untyped variables (or variables of type *) can be undefined.

frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(545): col: 62 Illogical comparison with undefined.  Only untyped variables (or variables of type *) can be undefined.

On 3/19/19, 10:37 AM, "carlosrovira@apache.org" <ca...@apache.org> wrote:

    This is an automated email from the ASF dual-hosted git repository.
    
    carlosrovira pushed a commit to branch develop
    in repository https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C35235ceb47444d6a133008d6ac918194%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886138274728662&amp;sdata=vGYTijIVYA28CqdBGvQ4cOMUn2TKbfbQi%2BkIqvtchkY%3D&amp;reserved=0
    
    
    The following commit(s) were added to refs/heads/develop by this push:
         new 9efd0d4  amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce access denied (401) errors that can generate messages without headers, but we still want Royale executes its faulhandler
    9efd0d4 is described below
    
    commit 9efd0d41ef153025d20447362ec1b66c1889303c
    Author: Carlos Rovira <ca...@apache.org>
    AuthorDate: Tue Mar 19 18:36:56 2019 +0100
    
        amfchannel: ensure headers are not undefined, this is needed in shared enviroments when the application can be hosted in a domain but served through other domain. In this cases interacting with AMF can produce access denied (401) errors that can generate messages without headers, but we still want Royale executes its faulhandler
    ---
     .../MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as      | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    index 8803f6b..3938a04 100644
    --- a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as
    @@ -542,11 +542,11 @@ public class AMFChannel extends NetConnectionChannel
                     _log.debug("'{0}' fault handler called. {1}", id, msg.toString());
     
                     // Set the server assigned RoyaleClient Id.
    -                if (RoyaleClient.getInstance().id == null && msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
    +                if (RoyaleClient.getInstance().id == null && msg.headers != undefined && msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null)
                         RoyaleClient.getInstance().id = msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER];
     
                     // Process the features advertised by the server endpoint.
    -                if (msg.headers[CommandMessage.MESSAGING_VERSION] != null)
    +                if (msg.headers != undefined && msg.headers[CommandMessage.MESSAGING_VERSION] != null)
                     {
                         var serverVersion:Number = msg.headers[CommandMessage.MESSAGING_VERSION] as Number;
                         handleServerMessagingVersion(serverVersion);