2006-06-16 19:19:16 +00:00
|
|
|
/* GSURLPrivate
|
|
|
|
Copyright (C) 2006 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Richard Frith-Macdonald <rfm@gnu.org>
|
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2006-06-16 19:19:16 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2006-06-16 19:19:16 +00:00
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2006-06-16 19:19:16 +00:00
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
MA 02111 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GSURLPrivate_h_
|
|
|
|
#define __GSURLPrivate_h_
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Headers needed by many URL loading classes
|
|
|
|
*/
|
2012-03-01 09:14:08 +00:00
|
|
|
#import "common.h"
|
2007-11-29 20:53:26 +00:00
|
|
|
#import "Foundation/NSArray.h"
|
|
|
|
#import "Foundation/NSAutoreleasePool.h"
|
|
|
|
#import "Foundation/NSData.h"
|
|
|
|
#import "Foundation/NSDictionary.h"
|
|
|
|
#import "Foundation/NSEnumerator.h"
|
|
|
|
#import "Foundation/NSException.h"
|
|
|
|
#import "Foundation/NSHTTPCookie.h"
|
|
|
|
#import "Foundation/NSHTTPCookieStorage.h"
|
|
|
|
#import "Foundation/NSLock.h"
|
|
|
|
#import "Foundation/NSStream.h"
|
|
|
|
#import "Foundation/NSString.h"
|
|
|
|
#import "Foundation/NSURL.h"
|
|
|
|
#import "Foundation/NSURLAuthenticationChallenge.h"
|
|
|
|
#import "Foundation/NSURLCache.h"
|
|
|
|
#import "Foundation/NSURLConnection.h"
|
|
|
|
#import "Foundation/NSURLCredential.h"
|
|
|
|
#import "Foundation/NSURLCredentialStorage.h"
|
|
|
|
#import "Foundation/NSURLDownload.h"
|
|
|
|
#import "Foundation/NSURLError.h"
|
|
|
|
#import "Foundation/NSURLProtectionSpace.h"
|
|
|
|
#import "Foundation/NSURLProtocol.h"
|
|
|
|
#import "Foundation/NSURLRequest.h"
|
|
|
|
#import "Foundation/NSURLResponse.h"
|
2006-06-16 19:19:16 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Private accessors for URL loading classes
|
|
|
|
*/
|
|
|
|
|
|
|
|
@interface NSURLRequest (Private)
|
2015-08-30 15:50:27 +00:00
|
|
|
- (BOOL) _debug;
|
2006-06-16 19:19:16 +00:00
|
|
|
- (id) _propertyForKey: (NSString*)key;
|
|
|
|
- (void) _setProperty: (id)value forKey: (NSString*)key;
|
|
|
|
@end
|
|
|
|
|
2006-06-19 11:20:17 +00:00
|
|
|
|
2007-05-11 06:15:05 +00:00
|
|
|
@interface NSURLResponse (Private)
|
|
|
|
- (void) _setHeaders: (id)headers;
|
2009-02-23 20:42:32 +00:00
|
|
|
- (void) _setStatusCode: (NSInteger)code text: (NSString*)text;
|
2007-05-11 06:15:05 +00:00
|
|
|
- (void) _setValue: (NSString *)value forHTTPHeaderField: (NSString *)field;
|
2007-05-11 15:47:06 +00:00
|
|
|
- (NSString*) _valueForHTTPHeaderField: (NSString*)field;
|
2007-05-11 06:15:05 +00:00
|
|
|
@end
|
|
|
|
|
2006-06-19 11:20:17 +00:00
|
|
|
|
2009-04-18 14:22:54 +00:00
|
|
|
@interface NSURLProtocol (Private)
|
|
|
|
+ (Class) _classToHandleRequest:(NSURLRequest *)request;
|
|
|
|
@end
|
2006-06-19 11:20:17 +00:00
|
|
|
|
|
|
|
/*
|
2006-06-20 09:52:57 +00:00
|
|
|
* Internal class for handling HTTP authentication
|
2006-06-19 11:20:17 +00:00
|
|
|
*/
|
2018-04-10 13:59:35 +00:00
|
|
|
@class NSLock;
|
2006-06-20 09:52:57 +00:00
|
|
|
@interface GSHTTPAuthentication : NSObject
|
2006-06-19 11:20:17 +00:00
|
|
|
{
|
2018-04-10 13:59:35 +00:00
|
|
|
NSLock *_lock;
|
2006-06-19 11:20:17 +00:00
|
|
|
NSURLCredential *_credential;
|
|
|
|
NSURLProtectionSpace *_space;
|
|
|
|
NSString *_nonce;
|
|
|
|
NSString *_opaque;
|
|
|
|
NSString *_qop;
|
|
|
|
int _nc;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* Return the object for the specified credential/protection space.
|
|
|
|
*/
|
2006-07-04 10:54:12 +00:00
|
|
|
+ (GSHTTPAuthentication *) authenticationWithCredential:
|
|
|
|
(NSURLCredential*)credential
|
|
|
|
inProtectionSpace: (NSURLProtectionSpace*)space;
|
|
|
|
|
2006-06-19 15:06:08 +00:00
|
|
|
/*
|
2006-06-20 09:52:57 +00:00
|
|
|
* Create/return the protection space involved in the specified authentication
|
|
|
|
* header returned in a response to a request sent to the URL.
|
2006-06-19 15:06:08 +00:00
|
|
|
*/
|
2006-06-20 09:52:57 +00:00
|
|
|
+ (NSURLProtectionSpace*) protectionSpaceForAuthentication: (NSString*)auth
|
|
|
|
requestURL: (NSURL*)URL;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Return the protection space for the specified URL (if known).
|
|
|
|
*/
|
|
|
|
+ (NSURLProtectionSpace *) protectionSpaceForURL: (NSURL*)URL;
|
|
|
|
|
|
|
|
+ (void) setProtectionSpace: (NSURLProtectionSpace *)space
|
|
|
|
forDomains: (NSArray*)domains
|
|
|
|
baseURL: (NSURL*)base;
|
|
|
|
|
2006-06-19 11:20:17 +00:00
|
|
|
/*
|
|
|
|
* Generate next authorisation header for the specified authentication
|
|
|
|
* header, method, and path.
|
|
|
|
*/
|
|
|
|
- (NSString*) authorizationForAuthentication: (NSString*)authentication
|
|
|
|
method: (NSString*)method
|
|
|
|
path: (NSString*)path;
|
|
|
|
- (NSURLCredential *) credential;
|
|
|
|
- (id) initWithCredential: (NSURLCredential*)credential
|
2006-07-04 10:54:12 +00:00
|
|
|
inProtectionSpace: (NSURLProtectionSpace*)space;
|
2006-06-19 11:20:17 +00:00
|
|
|
- (NSURLProtectionSpace *) space;
|
|
|
|
@end
|
|
|
|
|
2006-06-16 19:19:16 +00:00
|
|
|
#endif
|
|
|
|
|