util: buffer: Encode URIs with upper case hex characters

rfc3986 uses uppercase characters so switch to using them as well.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-10-24 13:26:16 +02:00
parent 5fdad0db2c
commit c721cc1670
2 changed files with 2 additions and 2 deletions

View File

@ -663,7 +663,7 @@ virBufferURIEncodeString(virBufferPtr buf, const char *str)
int grow_size = 0;
const char *p;
unsigned char uc;
const char *hex = "0123456789abcdef";
const char *hex = "0123456789ABCDEF";
if ((buf == NULL) || (str == NULL))
return;

View File

@ -184,7 +184,7 @@ mymain(void)
{ NULL, NULL, false },
};
TEST_FULL("spice://[3ffe::104]:5900/?tlsSubject=C=XX,L=Testtown,O=Test%20Company,CN=tester.test",
"spice://[3ffe::104]:5900/?tlsSubject=C%3dXX%2cL%3dTesttown%2cO%3dTest%20Company%2cCN%3dtester.test",
"spice://[3ffe::104]:5900/?tlsSubject=C%3DXX%2CL%3DTesttown%2CO%3DTest%20Company%2CCN%3Dtester.test",
"spice", "3ffe::104", 5900, "/", "tlsSubject=C=XX,L=Testtown,O=Test%20Company,CN=tester.test", NULL, NULL, spiceparams);
virURIParam params1[] = {