bugGNUstep - Bugs: bug #19228, Discrepancy in Cocoa/GNUstepBase...

Group
 
 

bug #19228: Discrepancy in Cocoa/GNUstepBase handling HTTP 401 status

Submitter:  Graham J Lee <iamleeg>
Submitted:  Wed 07 Mar 2007 11:07:20 AM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 07 Mar 2007 02:01:20 PM UTC, comment #2: 

I have changed the code in svn-trunk to call -cancelLoadInBackground if it receives an http status code outside the 200-299 range.  I'm not sure that this matches the MacOS-X behavior ... just my guess at what they might be doing.

Richard Frith-Macdonald <CaS>
Group Member
Wed 07 Mar 2007 12:09:22 PM UTC, comment #1: 

Same goes for HTTP 404 responses - test case updated.

Graham J Lee <iamleeg>
Wed 07 Mar 2007 11:07:20 AM UTC, original submission:  

See the file tests/testsuite/base/NSURLHandle/test01.m

On Cocoa, when you load a resource with an NSURLHandle over HTTP, and the server returns a 401 status code:

  • [handle loadInForeground] returns nil
  • [handle status] is set to NSURLHandleNotLoaded

whereas with -base:

  • [handle loadInForeground] returns the data in the body of the response
  • [handle status] is set to NSURLHandleLoaded


in both cases, [handle propertyForKey: @"WWW-Authenticate"] is correctly set to the WWW-Authenticate header.  To me, both of these approaches are a little bizarre: if the webserver returned data, then that should be available after the fetch (as -base does, and Cocoa doesn't).  OTOH, the resource which we set out to get hasn't yet been retrieved, so NSURLHandleNotLoaded is appropriate (as Cocoa does and -base doesn't).  Still, the discrepancy's there.

Graham J Lee <iamleeg>

 

(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 CaS (Posted a comment)
  • -email is unavailable- added by iamleeg (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-04-15 CaS Open/ClosedOpen Closed
    2007-03-07 CaS StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code