ObjFW  Check-in [38ccb06dff]

Overview
Comment:ofhttp: Allow insecure redirects with --insecure
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 38ccb06dff305071ea3be32d5935015dc7a839632802c16068a063cc7e5eb203
User & Date: js on 2018-03-11 20:47:45
Other Links: manifest | tags
Context
2018-03-11
21:43
Add -[OFString isAbsolutePath] check-in: c6299422a1 user: js tags: trunk
20:47
ofhttp: Allow insecure redirects with --insecure check-in: 38ccb06dff user: js tags: trunk
20:38
ofhttp: Print headers as we receive them check-in: 892fbf97ac user: js tags: trunk
Changes

Modified utils/ofhttp/OFHTTP.m from [3e501ee1e4] to [de7a31ac42].

107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
		    @"-P  --proxy          "
		    @"  Specify SOCKS5 proxy\n    "
		    @"-q  --quiet          "
		    @"  Quiet mode (no output, except errors)\n    "
		    @"-v  --verbose        "
		    @"  Verbose mode (print headers)\n    "
		    @"    --insecure       "
		    @"  Ignore TLS errors")];
	}

	[OFApplication terminateWithStatus: status];
}

static OFString *
fileNameFromContentDisposition(OFString *contentDisposition)







|







107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
		    @"-P  --proxy          "
		    @"  Specify SOCKS5 proxy\n    "
		    @"-q  --quiet          "
		    @"  Quiet mode (no output, except errors)\n    "
		    @"-v  --verbose        "
		    @"  Verbose mode (print headers)\n    "
		    @"    --insecure       "
		    @"  Ignore TLS errors and allow insecure redirects")];
	}

	[OFApplication terminateWithStatus: status];
}

static OFString *
fileNameFromContentDisposition(OFString *contentDisposition)
493
494
495
496
497
498
499



500
501
502
503
504
505
506
		    OF_LOCALIZED(@"output_only_with_one_url",
		    @"%[prog]: Cannot use -o / --output when more than one URL "
		    @"has been specified!",
		    @"prog", [OFApplication programName])];
		[OFApplication terminateWithStatus: 1];
	}




	[self performSelector: @selector(downloadNextURL)
		   afterDelay: 0];
}

-    (void)client: (OFHTTPClient *)client
  didCreateSocket: (OF_KINDOF(OFTCPSocket *))sock
	  request: (OFHTTPRequest *)request







>
>
>







493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
		    OF_LOCALIZED(@"output_only_with_one_url",
		    @"%[prog]: Cannot use -o / --output when more than one URL "
		    @"has been specified!",
		    @"prog", [OFApplication programName])];
		[OFApplication terminateWithStatus: 1];
	}

	if (_insecure)
		[_HTTPClient setInsecureRedirectsAllowed: true];

	[self performSelector: @selector(downloadNextURL)
		   afterDelay: 0];
}

-    (void)client: (OFHTTPClient *)client
  didCreateSocket: (OF_KINDOF(OFTCPSocket *))sock
	  request: (OFHTTPRequest *)request

Modified utils/ofhttp/lang/de.json from [8f934f3140] to [9dfc23927e].

11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
        "    -m  --method           HTTP Request-Methode setzen\n",
        "    -o  --output           Ausgabe-Dateiname angeben\n",
        "    -O  --detect-filename  Dateiname mittels HEAD-Request ermitteln\n",
        "    -P  --proxy            SOCKS5-Proxy angeben\n",
        "    -q  --quiet            Ruhiger Modus (keine Ausgabe außer Fehler)",
        "\n",
        "    -v  --verbose          Ausführlicher Modus (gibt Header aus)\n",
        "        --insecure         TLS-Fehler ignorieren"

    ],
    "invalid_input_header": "%[prog]: Header müssen im Format Name:Wert sein!",
    "invalid_input_method": "%[prog]: Ungültige Request-Methode %[method]!",
    "invalid_input_proxy": "%[prog]: Proxy muss im Format Host:Port sein!",
    "long_argument_missing": "%[prog]: Argument für Option --%[opt] fehlt",
    "argument_missing": "%[prog]: Argument für option -%[opt] fehlt",
    "option_takes_no_argument": "%[prog]: Option --%[opt] nimmt kein Argument",







|
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
        "    -m  --method           HTTP Request-Methode setzen\n",
        "    -o  --output           Ausgabe-Dateiname angeben\n",
        "    -O  --detect-filename  Dateiname mittels HEAD-Request ermitteln\n",
        "    -P  --proxy            SOCKS5-Proxy angeben\n",
        "    -q  --quiet            Ruhiger Modus (keine Ausgabe außer Fehler)",
        "\n",
        "    -v  --verbose          Ausführlicher Modus (gibt Header aus)\n",
        "        --insecure         TLS-Fehler ignorieren und unsichere\n",
        "                           Weiterleitungen erlauben"
    ],
    "invalid_input_header": "%[prog]: Header müssen im Format Name:Wert sein!",
    "invalid_input_method": "%[prog]: Ungültige Request-Methode %[method]!",
    "invalid_input_proxy": "%[prog]: Proxy muss im Format Host:Port sein!",
    "long_argument_missing": "%[prog]: Argument für Option --%[opt] fehlt",
    "argument_missing": "%[prog]: Argument für option -%[opt] fehlt",
    "option_takes_no_argument": "%[prog]: Option --%[opt] nimmt kein Argument",