Subject: Question about Accept header and structured suffixes

From: Jack Firth <[email-masked]>
Date: Tue, 12 Sep 2017 12:23:30 -0500

RFC 6838 Section 4.2.8 defines Structured Syntax Name Suffixes, allowing
types to use a +
symbol to indicate they are subtypes of another media type such as
application/atom+xml and
application/xml. How do subtypes interact with the Accept header? Is a
server allowed to
respond to a request with Accept: application/xml with Content-Type:
application/atom+xml? I
imagine many clients compare the returned content type with their requested
content type with
a simple equality check, which would raise an error in this case. Is that
bad behavior on the
part of the client? If not, how should a client indicate that it accepts a
media type and any subtype
of that type?

P.S. This is my first post to the ietf-http-wg list. If this is not the
appropriate place for such a
question or there is some other issue with my post, please don't hesitate
to let me know.

---

From: Remy Lebeau <[email-masked]>
Date: Tue, 12 Sep 2017 10:49:46 -0700

"application/atom+xml" is not a sub-type of "application/xml", so the 
server would not be allowed to send "application/atom+xml" if the client 
accepts only "application/xml".

"application/atom+xml" is a sub-type of "application/atom".  Even if the 
client specified it accepts "application/atom", "application/atom+xml" 
is still a distinct media type and would not be acceptable.  Neither 
RFCs 2616 nor 7231 make any allowance for "+" sub-types, so my 
interpretation is that the client would have to state 
"application/atom+xml" specifically (or "application/*", or "*/*", or 
omit the "Accept" header) in order for the server to send 
"application/atom+xml".

Remy Lebeau
Lebeau Software

On 9/12/2017 10:23 AM, Jack Firth wrote:
> RFC 6838 Section 4.2.8 defines Structured Syntax Name Suffixes, 
> allowing types to use a +
> imagine many clients compare the returned content type with their 
> requested content type with
> a simple equality check, which would raise an error in this case. Is 
> that bad behavior on the
> part of the client? If not, how should a client indicate that it 
> accepts a media type and any subtype
> of that type?
>
> P.S. This is my first post to the ietf-http-wg list. If this is not 
> the appropriate place for such a
> question or there is some other issue with my post, please don't 
> hesitate to let me know.
>
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> 
> 	Virus-free. www.avg.com 
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> 
>
>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

---

From: Matthew Kerwin <[email-masked]>
Date: Wed, 13 Sep 2017 08:06:17 +1000

(top posting because Gmail app, sorry)

The server is *allowed* to send whatever it wants. If you want to follow
strict conneg, though...

Speaking of, whatever happened to RFC 2295?

Cheers
-- 
Matthew Kerwin

On 13 Sep. 2017 03:53, "Remy Lebeau" <[email-masked]> wrote:

"application/atom+xml" is not a sub-type of "application/xml", so the
server would not be allowed to send "application/atom+xml" if the client
accepts only "application/xml".
"application/atom+xml" is a sub-type of "application/atom".  Even if the
client specified it accepts "application/atom", "application/atom+xml" is
still a distinct media type and would not be acceptable.  Neither RFCs 2616
nor 7231 make any allowance for "+" sub-types, so my interpretation is that
the client would have to state "application/atom+xml" specifically (or
"application/*", or "*/*", or omit the "Accept" header) in order for the
server to send "application/atom+xml".

Remy Lebeau
Lebeau Software

<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
Virus-free.
www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
<#m_-2518889896622846575_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

---

From: Martin J. Dürst <[email-masked]>
Date: Wed, 13 Sep 2017 12:19:49 +0900

> The server is *allowed* to send whatever it wants. If you want to follow

Yes. To be a bit more specific, the server can decide to send the 
document as application/atom+xml (because this is the only thing it 
has), or can decide to send the document as application/xml (because its 
logic or settings allow that, and it's definitely not wrong at all).

Regards,   Martin.