Re: draft-ietf-httpbis-header-structure-15.txt, 4.1.6. Serializing a String

> Hi Kari,
> 
> > On 17 Feb 2020, at 4:38 am, Kari Hurtta <hurtta-ietf@elmme-mailer.org> wrote:
> > 
> > 4.1.6.  Serializing a String
> > https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-15#section-4.1.6
> > 	
> > 
> > Output is restricted ASCII, but this alogrithm seems not say that
> > input_string is limited to ASCII
> > 
> > |   Given a string as input_string, return an ASCII string suitable for
> > |   use in a HTTP header value.
> > |
> > |   1.  If input_string is not a sequence of characters, or contains
> > |       characters in the range %x00-1f or %x7f (i.e., is not in VCHAR or
> > |       SP), fail serialisation.
> > 
> > In other words, should this fail serialization if input_string is not
> > ASCII string ?
> 
> That's one of the effects of this step, yes. See the definition of the string data type at:
>   https://httpwg.org/http-extensions/draft-ietf-httpbis-header-structure.html#string
> 
> 
> > Now failing is implicit, because there is just
> > 
> > |       2.  Append char to output.
> > 
> > And if char is not ASCII then "return an ASCII string" part
> > is violated.
> > 
> > / Kari Hurtta
> > 
> 
> --
> Mark Nottingham   https://www.mnot.net/


Well, I disagree that this is ready.

4.1.5.  Serializing a Decimal
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-15#section-4.1.5

tries define rounding.

This means that input_decimal is NOT decimal as defined on

3.3.2.  Decimals
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-15#section-3.3.2

So that this is consistent


4.1.6.  Serializing a String
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-15#section-4.1.6

	
input_string is NOT string as defined on

3.3.3.  Strings
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-15#section-3.3.3


So let input_decimal to be some kind generic/abstract decimal number and
therefore input_string to be some kind generic/abstract string.

Make this failure more explicit. For example:

  1.  Convert input_string into an ASCII string ascii_string; if
      conversion fails, fail serialisation.

  2.  If ascii_string contains characters in the range %x00-1f or 
      %x7f (i.e., is not in VCHAR or SP), fail serialisation.

  3.  Let output be an empty string.

  4.  Append DQUOTE to output.


  5. For each character char in ascii_string:

     and so on


/ Kari Hurtta

Received on Tuesday, 18 February 2020 17:08:29 UTC