Datalink feedback IV

Norman Gray norman at astro.gla.ac.uk
Mon Mar 31 02:52:16 PDT 2014


Markus, hello.

Let me through, let me through... I'm a standards lawyer...

On 2014 Mar 31, at 10:24, Markus Demleitner <msdemlei at ari.uni-heidelberg.de> wrote:

>>    application/x-votable+xml;content=datalink;charset=iso-8859-1
> 
> That's a valid point, yes, although I'd certainly discourage
> the use of charsets in any XML MIME type, as XML defines its encoding
> inline.

The encoding in an HTTP content-type header is more authoritative than an encoding in an XML document's encoding-declaration.

I can find chapter and verse if we need it, but that's my pretty clear understanding.

>>    application/x-votable+xml; content=datalink
>>    application/x-votable+xml;content="datalink"
> 
> Another valid point.  All this is nasty because a service
> implementation may not even be able to fully control the
> *serialization* of the content-type header to the level of whitespace
> or possibly the sequence of parameters; think, e.g., HTTP layers
> doing content negotiation.

Indeed.  Which I think means that...

> But, while I'm all for not constraining things such that code
> compliant with upstream standards may break us, this:
> 
>> This would probably not cause problems in practice, but it would be
>> more robust to say something like:
>> 
>>    ... MUST give a type/subtype of "application/x-votable+xml" with
>>    the "content" parameter set to "datalink"
>>    (e.g. "application/x-votable+xml;content=datalink") ...
> 
> is also not quite ideal.  

...while maybe not ideal, is nonetheless unavoidable.  Parsing the content-type HTTP header seems unavoidable.

Note also that RFC 2616 (Sect 7.2.1) says:

>    If and only if the media type is not given by a Content-Type field, the
>    recipient MAY attempt to guess the media type via inspection of its
>    content [...]

That means that encoding declarations within a VOTable, or I think elsewhere, can't override the content of an HTTP Content-Type header, if the VOTable was indeed delivered via HTTP. 

>  If the incoming request had a DALI RESPONSEFORMAT parameter,
>  content-type follows DALI's rules.

All the best,

Norman


-- 
Norman Gray  :  http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK



More information about the dal mailing list