diff -r e5976864dfe9 -r a910102a1c9d URLUtils.h --- a/URLUtils.h Sat May 24 13:24:33 2008 -0700 +++ b/URLUtils.h Tue Apr 07 11:13:25 2009 -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;