[7.6] Error with WebOS browser and OpenTalk

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

[7.6] Error with WebOS browser and OpenTalk

Carl Gundel-2
I am getting an error "Wrong response status line: Origin:" with my
Seaside app running on OpenTalk VW7.6 when accessing it from WebOS
browser.  In the following method it doesn't know what to make of the
Origin: token.

Net.HttpParser>>startMessageFrom: aStream
       | scanner fLine rfc822Scanner aString |
       aStream text.
       rfc822Scanner := self scannerOn: aStream.
       aString := rfc822Scanner nextLine.
       aString isEmpty
               ifTrue: [^HttpStatusLineError new
                               messageText:
(#EmptyHttpResponseStatusLine << #net >> 'Can not
read external stream, returns empty the Http response status line')
asString;
                               raiseSignal].
       scanner := self scannerOn: aString readStream.
       fLine := ('http' match: scanner nextToken asLowercase)
               ifTrue: [HttpResponseStatusLine readFrom: aString readStream]
               ifFalse:        [HttpRequestLine readFrom: aString readStream ].

       (fLine isNil or: [ fLine isValid not ])
               ifTrue: [ ^HttpEntityError new messageText:
((#WrongResponseStatusLine << #net >> 'Wrong response status line:
<1s>')
                       expandMacrosWith: fLine printString); raiseSignal ].

       ^self handler startMessage: fLine.

Below are GETs and POSTs from the browser.  Any ideas?

Thanks,

-Carl Gundel
http://www.runbasic.com


GET /runbasiciphone/ HTTP/1.1
Host: irunbasic.com
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
(KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
X-Palm-Carrier: c001-01
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Max-Forwards: 10
X-Forwarded-For: 166.196.136.120
X-Forwarded-Host: irunbasic.com
X-Forwarded-Server: irunbasic.com

POST /runbasiciphone/runbasiciphone HTTP/1.1
Host: irunbasic.com
Accept-Encoding: gzip, deflate
Origin: http://irunbasic.com
User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
(KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
Content-Type: application/x-www-form-urlencoded
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Referer: http://irunbasic.com/
Accept-Language: en-us,en;q=0.5
X-Palm-Carrier: c001-01
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Max-Forwards: 10
X-Forwarded-For: 166.196.136.120
X-Forwarded-Host: irunbasic.com
X-Forwarded-Server: irunbasic.com
Content-Length: 48

3.x=15&3.y=17&6=&_s=rZAyiukTZPIKxwql&_k=uyqRFLel

GET /runbasiciphone/runbasiciphone?_s=rZAyiukTZPIKxwql&_k=zQdrIqnQ HTTP/1.1
Host: irunbasic.com
Accept-Encoding: gzip, deflate
Cookie:
Origin: http://irunbasic.com
User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
(KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
Content-Type: application/x-www-form-urlencoded
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Referer: http://irunbasic.com/
Accept-Language: en-us,en;q=0.5
X-Palm-Carrier: c001-01
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Max-Forwards: 10
X-Forwarded-For: 166.196.136.120
X-Forwarded-Host: irunbasic.com
X-Forwarded-Server: irunbasic.com
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [7.6] Error with WebOS browser and OpenTalk

Kogan, Tamara
Carl,

You need to check if the response has the end-of-line marker as CRLF for header fields.

Tamara Kogan
Smalltalk development,
Cincom Systems
 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Carl Gundel
> Sent: Tuesday, February 15, 2011 10:16 PM
> To: vwnc
> Subject: [vwnc] [7.6] Error with WebOS browser and OpenTalk
>
> I am getting an error "Wrong response status line: Origin:" with my
> Seaside app running on OpenTalk VW7.6 when accessing it from WebOS
> browser.  In the following method it doesn't know what to make of the
> Origin: token.
>
> Net.HttpParser>>startMessageFrom: aStream
>        | scanner fLine rfc822Scanner aString |
>        aStream text.
>        rfc822Scanner := self scannerOn: aStream.
>        aString := rfc822Scanner nextLine.
>        aString isEmpty
>                ifTrue: [^HttpStatusLineError new
>                                messageText:
> (#EmptyHttpResponseStatusLine << #net >> 'Can not
> read external stream, returns empty the Http response status line')
> asString;
>                                raiseSignal].
>        scanner := self scannerOn: aString readStream.
>        fLine := ('http' match: scanner nextToken asLowercase)
>                ifTrue: [HttpResponseStatusLine readFrom:
> aString readStream]
>                ifFalse:        [HttpRequestLine readFrom:
> aString readStream ].
>
>        (fLine isNil or: [ fLine isValid not ])
>                ifTrue: [ ^HttpEntityError new messageText:
> ((#WrongResponseStatusLine << #net >> 'Wrong response status line:
> <1s>')
>                        expandMacrosWith: fLine printString);
> raiseSignal ].
>
>        ^self handler startMessage: fLine.
>
> Below are GETs and POSTs from the browser.  Any ideas?
>
> Thanks,
>
> -Carl Gundel
> http://www.runbasic.com
>
>
> GET /runbasiciphone/ HTTP/1.1
> Host: irunbasic.com
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
> (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
> Accept:
> application/xml,application/xhtml+xml,text/html;q=0.9,text/pla
> in;q=0.8,image/png,*/*;q=0.5
> Accept-Language: en-us,en;q=0.5
> X-Palm-Carrier: c001-01
> accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
> Max-Forwards: 10
> X-Forwarded-For: 166.196.136.120
> X-Forwarded-Host: irunbasic.com
> X-Forwarded-Server: irunbasic.com
>
> POST /runbasiciphone/runbasiciphone HTTP/1.1
> Host: irunbasic.com
> Accept-Encoding: gzip, deflate
> Origin: http://irunbasic.com
> User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
> (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
> Content-Type: application/x-www-form-urlencoded
> Accept:
> application/xml,application/xhtml+xml,text/html;q=0.9,text/pla
> in;q=0.8,image/png,*/*;q=0.5
> Referer: http://irunbasic.com/
> Accept-Language: en-us,en;q=0.5
> X-Palm-Carrier: c001-01
> accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
> Max-Forwards: 10
> X-Forwarded-For: 166.196.136.120
> X-Forwarded-Host: irunbasic.com
> X-Forwarded-Server: irunbasic.com
> Content-Length: 48
>
> 3.x=15&3.y=17&6=&_s=rZAyiukTZPIKxwql&_k=uyqRFLel
>
> GET
> /runbasiciphone/runbasiciphone?_s=rZAyiukTZPIKxwql&_k=zQdrIqnQ
>  HTTP/1.1
> Host: irunbasic.com
> Accept-Encoding: gzip, deflate
> Cookie:
> Origin: http://irunbasic.com
> User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
> (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
> Content-Type: application/x-www-form-urlencoded
> Accept:
> application/xml,application/xhtml+xml,text/html;q=0.9,text/pla
> in;q=0.8,image/png,*/*;q=0.5
> Referer: http://irunbasic.com/
> Accept-Language: en-us,en;q=0.5
> X-Palm-Carrier: c001-01
> accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
> Max-Forwards: 10
> X-Forwarded-For: 166.196.136.120
> X-Forwarded-Host: irunbasic.com
> X-Forwarded-Server: irunbasic.com
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [7.6] Error with WebOS browser and OpenTalk

Carl Gundel-2
Hi Tamara,

I'm not sure how to check the response.  If you're asking about the
GET and POST data I included in my original post and whether each line
ends with a CR and LF then the answer seems to be yes.

In the startMessageFrom: method I posted I notice that fLine isValid
returns false.  It doesn't know what to do with the Origin: token.  Is
this a non standard protocol, or is it something that the VW web
server needs to be extended to support?

Thanks,

-Carl Gundel
http://www.runbasic.com

On Wed, Feb 16, 2011 at 9:34 AM, Kogan, Tamara <[hidden email]> wrote:

> Carl,
>
> You need to check if the response has the end-of-line marker as CRLF for header fields.
>
> Tamara Kogan
> Smalltalk development,
> Cincom Systems
>
>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of Carl Gundel
>> Sent: Tuesday, February 15, 2011 10:16 PM
>> To: vwnc
>> Subject: [vwnc] [7.6] Error with WebOS browser and OpenTalk
>>
>> I am getting an error "Wrong response status line: Origin:" with my
>> Seaside app running on OpenTalk VW7.6 when accessing it from WebOS
>> browser.  In the following method it doesn't know what to make of the
>> Origin: token.
>>
>> Net.HttpParser>>startMessageFrom: aStream
>>        | scanner fLine rfc822Scanner aString |
>>        aStream text.
>>        rfc822Scanner := self scannerOn: aStream.
>>        aString := rfc822Scanner nextLine.
>>        aString isEmpty
>>                ifTrue: [^HttpStatusLineError new
>>                                messageText:
>> (#EmptyHttpResponseStatusLine << #net >> 'Can not
>> read external stream, returns empty the Http response status line')
>> asString;
>>                                raiseSignal].
>>        scanner := self scannerOn: aString readStream.
>>        fLine := ('http' match: scanner nextToken asLowercase)
>>                ifTrue: [HttpResponseStatusLine readFrom:
>> aString readStream]
>>                ifFalse:        [HttpRequestLine readFrom:
>> aString readStream ].
>>
>>        (fLine isNil or: [ fLine isValid not ])
>>                ifTrue: [ ^HttpEntityError new messageText:
>> ((#WrongResponseStatusLine << #net >> 'Wrong response status line:
>> <1s>')
>>                        expandMacrosWith: fLine printString);
>> raiseSignal ].
>>
>>        ^self handler startMessage: fLine.
>>
>> Below are GETs and POSTs from the browser.  Any ideas?
>>
>> Thanks,
>>
>> -Carl Gundel
>> http://www.runbasic.com
>>
>>
>> GET /runbasiciphone/ HTTP/1.1
>> Host: irunbasic.com
>> Accept-Encoding: gzip, deflate
>> User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
>> (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
>> Accept:
>> application/xml,application/xhtml+xml,text/html;q=0.9,text/pla
>> in;q=0.8,image/png,*/*;q=0.5
>> Accept-Language: en-us,en;q=0.5
>> X-Palm-Carrier: c001-01
>> accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
>> Max-Forwards: 10
>> X-Forwarded-For: 166.196.136.120
>> X-Forwarded-Host: irunbasic.com
>> X-Forwarded-Server: irunbasic.com
>>
>> POST /runbasiciphone/runbasiciphone HTTP/1.1
>> Host: irunbasic.com
>> Accept-Encoding: gzip, deflate
>> Origin: http://irunbasic.com
>> User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
>> (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
>> Content-Type: application/x-www-form-urlencoded
>> Accept:
>> application/xml,application/xhtml+xml,text/html;q=0.9,text/pla
>> in;q=0.8,image/png,*/*;q=0.5
>> Referer: http://irunbasic.com/
>> Accept-Language: en-us,en;q=0.5
>> X-Palm-Carrier: c001-01
>> accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
>> Max-Forwards: 10
>> X-Forwarded-For: 166.196.136.120
>> X-Forwarded-Host: irunbasic.com
>> X-Forwarded-Server: irunbasic.com
>> Content-Length: 48
>>
>> 3.x=15&3.y=17&6=&_s=rZAyiukTZPIKxwql&_k=uyqRFLel
>>
>> GET
>> /runbasiciphone/runbasiciphone?_s=rZAyiukTZPIKxwql&_k=zQdrIqnQ
>>  HTTP/1.1
>> Host: irunbasic.com
>> Accept-Encoding: gzip, deflate
>> Cookie:
>> Origin: http://irunbasic.com
>> User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
>> (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
>> Content-Type: application/x-www-form-urlencoded
>> Accept:
>> application/xml,application/xhtml+xml,text/html;q=0.9,text/pla
>> in;q=0.8,image/png,*/*;q=0.5
>> Referer: http://irunbasic.com/
>> Accept-Language: en-us,en;q=0.5
>> X-Palm-Carrier: c001-01
>> accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
>> Max-Forwards: 10
>> X-Forwarded-For: 166.196.136.120
>> X-Forwarded-Host: irunbasic.com
>> X-Forwarded-Server: irunbasic.com
>> _______________________________________________
>> vwnc mailing list
>> [hidden email]
>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>>
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [7.6] Error with WebOS browser and OpenTalk

Kogan, Tamara
Hi Carl,

The HttpParser>>startMessageFrom: method is expected to read the very first line from an Http response. Depending on the Http code the fLine can be: 'HTTP/1.1 200 OK' or some kind of Http error code.
If the fLine happens to be another header field one of the reason is that the parser was not able to detect CRLF after the status line. You may inspect the aStream parameter and see if the correct line end is used and where the stream is positioned before executing the line:
aString := aStream nextLine and after.
Parsing the field "Origin: token" should not be a problem. The parser is going to return the field value as a string.

Tamara Kogan
Smalltalk development,
Cincom Systems
 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Carl Gundel
> Sent: Wednesday, February 16, 2011 7:22 PM
> To: vwnc
> Subject: Re: [vwnc] [7.6] Error with WebOS browser and OpenTalk
>
> Hi Tamara,
>
> I'm not sure how to check the response.  If you're asking about the
> GET and POST data I included in my original post and whether each line
> ends with a CR and LF then the answer seems to be yes.
>
> In the startMessageFrom: method I posted I notice that fLine isValid
> returns false.  It doesn't know what to do with the Origin: token.  Is
> this a non standard protocol, or is it something that the VW web
> server needs to be extended to support?
>
> Thanks,
>
> -Carl Gundel
> http://www.runbasic.com
>
> On Wed, Feb 16, 2011 at 9:34 AM, Kogan, Tamara
> <[hidden email]> wrote:
> > Carl,
> >
> > You need to check if the response has the end-of-line
> marker as CRLF for header fields.
> >
> > Tamara Kogan
> > Smalltalk development,
> > Cincom Systems
> >
> >
> >> -----Original Message-----
> >> From: [hidden email]
> >> [mailto:[hidden email]] On Behalf Of Carl Gundel
> >> Sent: Tuesday, February 15, 2011 10:16 PM
> >> To: vwnc
> >> Subject: [vwnc] [7.6] Error with WebOS browser and OpenTalk
> >>
> >> I am getting an error "Wrong response status line: Origin:" with my
> >> Seaside app running on OpenTalk VW7.6 when accessing it from WebOS
> >> browser.  In the following method it doesn't know what to
> make of the
> >> Origin: token.
> >>
> >> Net.HttpParser>>startMessageFrom: aStream
> >>        | scanner fLine rfc822Scanner aString |
> >>        aStream text.
> >>        rfc822Scanner := self scannerOn: aStream.
> >>        aString := rfc822Scanner nextLine.
> >>        aString isEmpty
> >>                ifTrue: [^HttpStatusLineError new
> >>                                messageText:
> >> (#EmptyHttpResponseStatusLine << #net >> 'Can not
> >> read external stream, returns empty the Http response status line')
> >> asString;
> >>                                raiseSignal].
> >>        scanner := self scannerOn: aString readStream.
> >>        fLine := ('http' match: scanner nextToken asLowercase)
> >>                ifTrue: [HttpResponseStatusLine readFrom:
> >> aString readStream]
> >>                ifFalse:        [HttpRequestLine readFrom:
> >> aString readStream ].
> >>
> >>        (fLine isNil or: [ fLine isValid not ])
> >>                ifTrue: [ ^HttpEntityError new messageText:
> >> ((#WrongResponseStatusLine << #net >> 'Wrong response status line:
> >> <1s>')
> >>                        expandMacrosWith: fLine printString);
> >> raiseSignal ].
> >>
> >>        ^self handler startMessage: fLine.
> >>
> >> Below are GETs and POSTs from the browser.  Any ideas?
> >>
> >> Thanks,
> >>
> >> -Carl Gundel
> >> http://www.runbasic.com
> >>
> >>
> >> GET /runbasiciphone/ HTTP/1.1
> >> Host: irunbasic.com
> >> Accept-Encoding: gzip, deflate
> >> User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
> >> (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
> >> Accept:
> >> application/xml,application/xhtml+xml,text/html;q=0.9,text/pla
> >> in;q=0.8,image/png,*/*;q=0.5
> >> Accept-Language: en-us,en;q=0.5
> >> X-Palm-Carrier: c001-01
> >> accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
> >> Max-Forwards: 10
> >> X-Forwarded-For: 166.196.136.120
> >> X-Forwarded-Host: irunbasic.com
> >> X-Forwarded-Server: irunbasic.com
> >>
> >> POST /runbasiciphone/runbasiciphone HTTP/1.1
> >> Host: irunbasic.com
> >> Accept-Encoding: gzip, deflate
> >> Origin: http://irunbasic.com
> >> User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
> >> (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
> >> Content-Type: application/x-www-form-urlencoded
> >> Accept:
> >> application/xml,application/xhtml+xml,text/html;q=0.9,text/pla
> >> in;q=0.8,image/png,*/*;q=0.5
> >> Referer: http://irunbasic.com/
> >> Accept-Language: en-us,en;q=0.5
> >> X-Palm-Carrier: c001-01
> >> accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
> >> Max-Forwards: 10
> >> X-Forwarded-For: 166.196.136.120
> >> X-Forwarded-Host: irunbasic.com
> >> X-Forwarded-Server: irunbasic.com
> >> Content-Length: 48
> >>
> >> 3.x=15&3.y=17&6=&_s=rZAyiukTZPIKxwql&_k=uyqRFLel
> >>
> >> GET
> >> /runbasiciphone/runbasiciphone?_s=rZAyiukTZPIKxwql&_k=zQdrIqnQ
> >>  HTTP/1.1
> >> Host: irunbasic.com
> >> Accept-Encoding: gzip, deflate
> >> Cookie:
> >> Origin: http://irunbasic.com
> >> User-Agent: Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2
> >> (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1
> >> Content-Type: application/x-www-form-urlencoded
> >> Accept:
> >> application/xml,application/xhtml+xml,text/html;q=0.9,text/pla
> >> in;q=0.8,image/png,*/*;q=0.5
> >> Referer: http://irunbasic.com/
> >> Accept-Language: en-us,en;q=0.5
> >> X-Palm-Carrier: c001-01
> >> accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
> >> Max-Forwards: 10
> >> X-Forwarded-For: 166.196.136.120
> >> X-Forwarded-Host: irunbasic.com
> >> X-Forwarded-Server: irunbasic.com
> >> _______________________________________________
> >> vwnc mailing list
> >> [hidden email]
> >> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
> >>
> >
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc