bugGNUstep - Bugs: bug #41643, WebServer folds http header after...

Group
 
 

bug #41643: WebServer folds http header after 78th char with using GSMimeHeader

Submitter:  T.Somequare <tsomeqdev>
Submitted:  Thu 20 Feb 2014 01:31:37 AM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Item Group:  Change Request Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  In Test
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 21 Oct 2014 10:48:10 AM UTC, comment #4: 

Would you mind updating to 1.24.6 and report back if this issue is still valid? something looks inconsistent and you are trying to access an non-existant method.

Riccardo Mottola <rmottola>
Group Member
Tue 25 Feb 2014 04:24:03 AM UTC, comment #3: 

Sorry.
I checked some development environment ,
then GSMime on 1.24.3 .. 1.24.6 have  -rawMimeData:foldedAt: method,
but 1.24.0 does not have it.

T.Somequare <tsomeqdev>
Tue 25 Feb 2014 04:02:00 AM UTC, comment #2: 

Thank you.
I tested it but it did not run correctly.

[WebServerConnection-respond:] <NSException: 0x1ab83568> NAME:NSInvalidArgumentException REASON:-[WebServerResponse rawMimeData:foldedAt:]: unrecognized selector sent to instance 0x1ab7cd28 INFO:(null)

Perhaps, this version is not compatible with the latest version of GSMime 1.24.x.


T.Somequare <tsomeqdev>
Mon 24 Feb 2014 01:39:17 PM UTC, comment #1: 

Thanks for that idea … I have updated the library in svn trunk by adding -setFoldHeaders: methods to the WebServer and WebServerResponse classes.
That should allow you to turn off header folding for either all responseses or for individual responses, so you can cope with buggy client code either
1. by turning off folding for every response … if you know only the faulty clients will be connecting or
2. turning off folding for individual responses if you use some heuristic (looking at the headers in a request) to see if you are dealing with a faulty client or a normal client which expects folded headers.

Please can you give it a try and let me know if it's all working.

Richard Frith-Macdonald <CaS>
Group Member
Thu 20 Feb 2014 01:31:37 AM UTC, original submission:  

The WebServer app uses GSMimeDocument class to pack http response,
and also use GSMimeHeader class for HTTP header.

The GSMimeHeader`s -rawMimeData method internally calls [self rawMimeDataPreservingCase: NO foldedAt:78].

I expect:

 HTTP/1.1 200 OK
 Date: Thu, 20 Feb 2014 00:40:53 GMT
 Set-Cookie: fdfdfdfdfdfdffff ff ffff ..(78byte length).. fffff fffff ffffff
 Other-Header: xxx

But produced HTTP Header :

 HTTP/1.1 200 OK
 Date: Thu, 20 Feb 2014 00:40:53 GMT
 Set-Cookie: fdfdfdfdfdfdffff ff ffff ..(78byte length)..
       fffff fffff ffffff
 Other-Header: xxx

This behavior may make some web browsers to confuse parsing.
The example above breaks cookie value.


T.Somequare <tsomeqdev>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rmottola (Posted a comment)
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by tsomeqdev (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-24 CaS CategoryApplication Libraries
        Item GroupNone Change Request
        StatusNone Fixed
        Open/ClosedOpen In Test

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code