El Lunes, 16 de Febrero de 2009, Iñaki Baz Castillo escribió:
> Hi, Accept header allows parameters in a confusing way:
>
> -----------------------
> Accept         =  "Accept" HCOLON
>                    [ accept-range *(COMMA accept-range) ]
> accept-range   =  media-range *(SEMI accept-param)
> media-range    =  ( "*/*"
>                   / ( m-type SLASH "*" )
>                   / ( m-type SLASH m-subtype )
>                   ) *( SEMI m-parameter )
> accept-param   =  ("q" EQUAL qvalue) / generic-param
> qvalue         =  ( "0" [ "." 0*3DIGIT ] )
>                   / ( "1" [ "." 0*3("0") ] )
> generic-param  =  token [ EQUAL gen-value ]
> gen-value      =  token / host / quoted-string
>
> m-parameter      =  m-attribute EQUAL m-value
> m-attribute      =  token
> m-value          =  token / quoted-string
> --------------------------
>
> Take the following example:
>
>   Accept: application/sdp;q=0.5;paramX=qwe
>
> Accorsing to the BNF syntax it's not possible to know if "q=0.5"
> and "paramX=qwe" are 'accept-param' or 'm-parameter' (they could be both
> with no way to differentiate between them).

As a workaround I've changed the BNF as follows:

BEFORE:
  Accept         =  "Accept" HCOLON [ accept-range *(COMMA accept-range) ]
  accept-range   =  media-range *(SEMI accept-param)
  media-range    =  ( "*/*"
                    / ( m-type SLASH "*" )
                    / ( m-type SLASH m-subtype )
                    ) *( SEMI m-parameter )

NOW:
BEFORE:
  Accept         =  "Accept" HCOLON [ accept-range *(COMMA accept-range) ]
  accept-range   =  media-range *(SEMI accept-param)
  media-range    =  ( "*/*"
                    / ( m-type SLASH "*" )
                    / ( m-type SLASH m-subtype )
                    )

I've removed '*( SEMI m-parameter )' since it duplicates '*(SEMI 
accept-param)' so makes no sense.

I hope it is the correct approach.

Regards.


-- 
Iñaki Baz Castillo

_______________________________________________
Sip-implementors mailing list
[email protected]
https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors

Reply via email to