Issue 298 in glassdb: FastCGI parsing of content-length header fails on present but empty header

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

Issue 298 in glassdb: FastCGI parsing of content-length header fails on present but empty header

glassdb
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium GLASS-Server Version-GLASS0.231

New issue 298 by norbert.hartl: FastCGI parsing of content-length header  
fails on present but empty header
http://code.google.com/p/glassdb/issues/detail?id=298

WAFastCGIAdaptor>>contentLengthHeader parses the content length from HTTP  
header. The covered cases are existing header with length data or missing  
header.

In my environment using nginx fastcgi headers are generated through a  
template and it generates header that are present but empty. That is the  
reason sqNumberParser emits an error because it parses an empty string

Reply | Threaded
Open this post in threaded view
|

Re: Issue 298 in glassdb: FastCGI parsing of content-length header fails on present but empty header

glassdb

Comment #1 on issue 298 by norbert.hartl: FastCGI parsing of content-length  
header fails on present but empty header
http://code.google.com/p/glassdb/issues/detail?id=298

I tried to commit a FastCGI package but saw that I don't have commit  
rights. There is only one line to change

WAFastCGIAdaptor>>contentLengthHeader
        ^((params at: 'CONTENT_LENGTH' ifAbsent: ['0']) ifEmpty: [ '0' ]) asNumber


Reply | Threaded
Open this post in threaded view
|

Re: Issue 298 in glassdb: FastCGI parsing of content-length header fails on present but empty header

glassdb

Comment #2 on issue 298 by norbert.hartl: FastCGI parsing of content-length  
header fails on present but empty header
http://code.google.com/p/glassdb/issues/detail?id=298

It is in FSRole>>contentLengthHeader of course

Reply | Threaded
Open this post in threaded view
|

Re: Issue 298 in glassdb: FastCGI parsing of content-length header fails on present but empty header

glassdb

Comment #3 on issue 298 by norbert.hartl: FastCGI parsing of content-length  
header fails on present but empty header
http://code.google.com/p/glassdb/issues/detail?id=298

I tried to commit a FastCGI package but saw that I don't have commit  
rights. There is only one line to change

FSROle>>contentLengthHeader
        ^((params at: 'CONTENT_LENGTH' ifAbsent: ['0']) ifEmpty: [ '0' ]) asNumber

Reply | Threaded
Open this post in threaded view
|

Re: Issue 298 in glassdb: FastCGI parsing of content-length header fails on present but empty header

glassdb

Comment #4 on issue 298 by norbert.hartl: FastCGI parsing of content-length  
header fails on present but empty header
http://code.google.com/p/glassdb/issues/detail?id=298

I can't change the details anymore. This is tested in 2.4.4.1

Reply | Threaded
Open this post in threaded view
|

Re: Issue 298 in glassdb: FastCGI parsing of content-length header fails on present but empty header

glassdb
Updates:
        Status: Started
        Owner: [hidden email]
        Labels: Milestone-1.0-beta.8.7

Comment #5 on issue 298 by [hidden email]: FastCGI parsing of  
content-length header fails on present but empty header
http://code.google.com/p/glassdb/issues/detail?id=298

(No comment was entered for this change.)

Reply | Threaded
Open this post in threaded view
|

Re: Issue 298 in glassdb: FastCGI parsing of content-length header fails on present but empty header

glassdb
In reply to this post by glassdb

Comment #7 on issue 298 by [hidden email]: FastCGI parsing of  
content-length header fails on present but empty header
http://code.google.com/p/glassdb/issues/detail?id=298

Somehow a 'nil' sneaked in
(Gs 2.4.5.1 with the fix applied in combination with either lighttpd or  
nginx)
when CONTENT_LENGTH was absent, I don't know why.

here is my current work-around, just for documentation, in case this bug  
hits again:

contentLengthHeader
        |p|
        p := params at: 'CONTENT_LENGTH' ifAbsent: '0'.
        ^ (p isNumber or: [p isString and: [p isAllDigits]])
                ifTrue: [p asNumber]
                ifFalse: [0]


Reply | Threaded
Open this post in threaded view
|

Re: Issue 298 in glassdb: FastCGI parsing of content-length header fails on present but empty header

glassdb

Comment #8 on issue 298 by [hidden email]: FastCGI parsing of  
content-length header fails on present but empty header
http://code.google.com/p/glassdb/issues/detail?id=298

Somehow a 'nil' sneaked in
(Gs 2.4.5.1 with the fix applied in combination with either lighttpd or  
nginx)
when CONTENT_LENGTH was absent, I don't know why.

here is my current work-around, just for documentation, in case this bug  
hits again:

contentLengthHeader
        |p|
        p := params at: 'CONTENT_LENGTH' ifAbsent: '0'.
        ^ (p isNumber or: [p isString and: [p notEmpty and: [p isAllDigits]]])
                ifTrue: [p asNumber]
                ifFalse: [0]