1.75b: iPhone U-A support added.

This commit is contained in:
Steve Pinkham 2010-11-21 07:40:21 -05:00
parent 514ec354db
commit 088136e95e
6 changed files with 32 additions and 8 deletions

View File

@ -1,3 +1,8 @@
Version 1.75b:
--------------
- iPhone U-A support added.
Version 1.74b:
--------------

3
README
View File

@ -312,7 +312,8 @@ parameters...
By default, skipfish sends minimalistic HTTP headers to reduce the amount of
data exchanged over the wire; some sites examine User-Agent strings or header
ordering to reject unsupported clients, however. In such a case, you can use
-b ie or -b ffox to mimic one of the two popular browsers.
-b ie, -b ffox, or -b phone to mimic one of the two popular browsers (or
iPhone).
When it comes to customizing your HTTP requests, you can also use the -H
option to insert any additional, non-standard headers; or -F to define a

View File

@ -893,7 +893,7 @@ u8* build_request_data(struct http_request* req) {
ASD("Keep-Alive: 300\r\n");
ASD("Connection: keep-alive\r\n");
} else /* MSIE */ {
} else if (browser_type == BROWSER_MSIE) {
ASD("Accept: */*\r\n");
@ -909,6 +909,22 @@ u8* build_request_data(struct http_request* req) {
ASD("Accept-Encoding: gzip, deflate\r\n");
ASD("Connection: Keep-Alive\r\n");
} else /* iPhone */ {
if (!GET_HDR((u8*)"User-Agent", &req->par))
ASD("User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS "
"X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 "
"Mobile/8B117 Safari/6531.22.7 SF/" VERSION "\r\n");
ASD("Accept: application/xml,application/xhtml+xml,text/html;q=0.9,"
"text/plain;q=0.8,image/png,*/*;q=0.5\r\n");
if (!GET_HDR((u8*)"Accept-Language", &req->par))
ASD("Accept-Language: en-us\r\n");
ASD("Accept-Encoding: gzip, deflate\r\n");
ASD("Connection: keep-alive\r\n");
}

View File

@ -391,6 +391,7 @@ extern u8 ignore_cookies;
#define BROWSER_FAST 0 /* Minimimal HTTP headers */
#define BROWSER_MSIE 1 /* Try to mimic MSIE */
#define BROWSER_FFOX 2 /* Try to mimic Firefox */
#define BROWSER_PHONE 3 /* Try to mimic iPhone */
extern u8 browser_type;

View File

@ -19,7 +19,7 @@ The final report generated by the tool is meant to serve as a foundation for pro
.B \-A user:pass
use specified HTTP authentication credentials
.TP
.B \-F host:IP
.B \-F host=IP
pretend that 'host' resolves to 'IP'
.TP
.B \-C name=val
@ -28,8 +28,8 @@ append a custom cookie to all requests
.B \-H name=val
append a custom HTTP header to all requests
.TP
.B \-b (i|f)
use headers consistent with MSIE / Firefox
.B \-b (i|f|p)
use headers consistent with MSIE / Firefox / iPhone
.TP
.B \-N
do not accept any new cookies
@ -91,7 +91,7 @@ be less noisy about MIME / charset mismatches on probably
static content
.TP
.B \-M
log warnings about mixed content
log warnings about mixed content or non-SSL password forms
.TP
.B \-E
log all HTTP/1.0 / HTTP/1.1 caching intent mismatches

View File

@ -73,10 +73,10 @@ static void usage(char* argv0) {
"Authentication and access options:\n\n"
" -A user:pass - use specified HTTP authentication credentials\n"
" -F host:IP - pretend that 'host' resolves to 'IP'\n"
" -F host=IP - pretend that 'host' resolves to 'IP'\n"
" -C name=val - append a custom cookie to all requests\n"
" -H name=val - append a custom HTTP header to all requests\n"
" -b (i|f) - use headers consistent with MSIE / Firefox\n"
" -b (i|f|p) - use headers consistent with MSIE / Firefox / iPhone\n"
" -N - do not accept any new cookies\n\n"
"Crawl scope options:\n\n"
@ -372,6 +372,7 @@ int main(int argc, char** argv) {
case 'b':
if (optarg[0] == 'i') browser_type = BROWSER_MSIE; else
if (optarg[0] == 'f') browser_type = BROWSER_FFOX; else
if (optarg[0] == 'p') browser_type = BROWSER_PHONE; else
usage(argv[0]);
break;