diff -r e5976864dfe9 -r a1044ae95953 URLUtils.h --- a/URLUtils.h Sat May 24 13:24:33 2008 -0700 +++ b/URLUtils.h Wed Jul 16 10:50:34 2008 -0700 @@ -9,6 +9,19 @@ #import +@interface NSURL (MYUtilities) + +/** Smart/lenient version of +URLWithString:, for use with user-entered URLs. + - Strips out any whitespace or newlines + - Removes surrounding "<...>" + - Adds a default scheme like http: if necessary, if one is provided + - Checks against a list of allowed schemes, if one is provided */ ++ (NSURL*) my_URLWithLenientString: (NSString*)string + defaultScheme: (NSString*)defaultScheme + allowedSchemes: (NSArray*)allowedSchemes; +@end + + @interface NSHTTPURLResponse (MYUtilities) - (NSError*) HTTPError;