ObjFW  Check-in [53efa86ce8]

Overview
Comment:ofhttpd: Never allow backslashes on Windows
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ofhttpd
Files: files | file ages | folders
SHA3-256: 53efa86ce89fa9885d413bbeed832032a4a045609b72bf95c4ba6d36ca432efc
User & Date: js on 2023-10-08 20:53:39
Other Links: branch diff | manifest | tags
Context
2023-10-15
14:33
ofhttpd: Handle HEAD requests check-in: b80f70a59b user: js tags: ofhttpd
2023-10-08
20:53
ofhttpd: Never allow backslashes on Windows check-in: 53efa86ce8 user: js tags: ofhttpd
11:37
Add utils/ofhttpd check-in: 849f08ce02 user: js tags: ofhttpd
Changes

Modified utils/ofhttpd/OFHTTPD.m from [e430368038] to [a5fd48a4c7].

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

	if (![path hasPrefix: @"/"])
		return nil;

	path = [path substringWithRange: OFMakeRange(1, path.length - 1)];

#if defined(OF_WINDOWS) || defined(OF_MSDOS)
	if ([path containsString: @":"] || [path hasPrefix: @"\\"])
#elif defined(OF_AMIGAOS)
	if ([path containsString: @":"] || [path hasPrefix: @"/"])
#else
	/* Shouldn't even be possible after standardization, but just in case */
	if ([path hasPrefix: @"/"])
#endif
		return nil;







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

	if (![path hasPrefix: @"/"])
		return nil;

	path = [path substringWithRange: OFMakeRange(1, path.length - 1)];

#if defined(OF_WINDOWS) || defined(OF_MSDOS)
	if ([path containsString: @":"] || [path containsString: @"\\"])
#elif defined(OF_AMIGAOS)
	if ([path containsString: @":"] || [path hasPrefix: @"/"])
#else
	/* Shouldn't even be possible after standardization, but just in case */
	if ([path hasPrefix: @"/"])
#endif
		return nil;