Re: [PATCH 13/19] util: buffer: Properly URLencode strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 24, 2019 at 03:56:31PM +0200, Peter Krempa wrote:
According to rfc3986:


Ah, it's been a while since I read that.

2.3.  Unreserved Characters

  Characters that are allowed in a URI but do not have a reserved
  purpose are called unreserved.  These include uppercase and lowercase
  letters, decimal digits, hyphen, period, underscore, and tilde.

     unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"

  URIs that differ in the replacement of an unreserved character with
  its corresponding percent-encoded US-ASCII octet are equivalent: they
  identify the same resource.  However, URI comparison implementations
  do not always perform normalization prior to comparison (see Section
  6).  For consistency, percent-encoded octets in the ranges of ALPHA
  (%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period (%2E),
  underscore (%5F), or tilde (%7E) should not be created by URI
  producers and, when found in a URI, should be decoded to their
  corresponding unreserved characters by URI normalizers.

Thus we must not include few other characters which don't match
c_isalpha to conform to the rules.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
src/util/virbuffer.c | 14 ++++++++++++--
tests/viruritest.c   |  2 +-
2 files changed, 13 insertions(+), 3 deletions(-)


Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux