mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
ecd1d020ab
Character set in POSIX is set by the locale defined (in decreasing order of precedence) by the LC_ALL, LC_CTYPE and LANG environment variables (I believe CHARSET is only historic). LC_ALL is cleared to ensure that LC_CTYPE takes effect, but LC_ALL is not used to set the locale to ensure that other parts of the locale aren't overriden, if set. Since there doesn't seem to be a cross-platform way of specifying a UTF-8 locale, and not all systems may support UTF-8, a <precheck> is used (where relevant) to skip the test if UTF-8 isn't in use. Test 1035 was also converted to UTF-8 for consistency, as the actual character set used there is irrelevant to the test.
68 lines
1.0 KiB
Plaintext
68 lines
1.0 KiB
Plaintext
<testcase>
|
||
<info>
|
||
<keywords>
|
||
HTTP
|
||
HTTP GET
|
||
HTTP proxy
|
||
IDN
|
||
FAILURE
|
||
</keywords>
|
||
</info>
|
||
|
||
#
|
||
# Server-side
|
||
<reply>
|
||
<data>
|
||
HTTP/1.0 503 Service Unavailable
|
||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||
Server: test-server/fake swsclose
|
||
Content-Type: text/html
|
||
Funny-head: yesyes
|
||
|
||
</data>
|
||
</reply>
|
||
|
||
#
|
||
# Client-side
|
||
<client>
|
||
<server>
|
||
http
|
||
</server>
|
||
<features>
|
||
idn
|
||
</features>
|
||
<setenv>
|
||
CHARSET=UTF-8
|
||
LC_ALL=
|
||
LC_CTYPE=UTF-8
|
||
</setenv>
|
||
<precheck>
|
||
perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
|
||
</precheck>
|
||
<name>
|
||
HTTP over proxy with malformatted IDN host name
|
||
</name>
|
||
|
||
# This host name contains an invalid UTF-8 byte sequence that can't be
|
||
# converted into an IDN name
|
||
<command>
|
||
http://invalid-utf8-â<>.local/page/1034 -x %HOSTIP:%HTTPPORT
|
||
</command>
|
||
</client>
|
||
|
||
#
|
||
# Verify data after the test has been "shot"
|
||
<verify>
|
||
<strip>
|
||
^User-Agent:.*
|
||
</strip>
|
||
<protocol>
|
||
GET http://invalid-utf8-â<>.local/page/1034 HTTP/1.1
|
||
Host: invalid-utf8-â<>.local
|
||
Accept: */*
|
||
Proxy-Connection: Keep-Alive
|
||
|
||
</protocol>
|
||
</verify>
|
||
</testcase>
|