Wrong Content-Type Header in Response of OSLC 2.0 Queries on RTC 6.0.6
Hi everyone,
3 answers
https://clm.example.com:9443/ccm/oslc/contexts/_6C1woKYbEeiSMJX2Iy-rvg/workitems/services.xml
Comments
When the request header key OSLC-Core-Version is missing, or has any other value than "2.0", RTC replies with OSLC 1.x by default, so the XML root tag in above case is oslc_cm:ServiceDescriptor.
The response header is used by Lyo (and most certainly by other OSLC frameworks) to detect the "language" of the response in order to be able to unmarshal to the class instance in the respective language.
I did look at the response headers and the content type I see is
-
content-type →application/x-oslc-cm-service-description+xml;charset=UTF-8
This is the response Content-Type header you get when you don't supply OSLC-Core-Version: 2.0 in the request, which is correct/expected for OSLC 1 and matches the returned XML, which is also OSLC 1 then.
This was Postman with
I am using Postman as well to try things out, and I can reproduce it.
This is what I see: (RTC 6.0.6, Postman embedded in Crome)
What the...... Must have been a typo, I went in to make sure and now I see what you see:
The actual contents (body) of the response is absolutely fine as far as I can tell. But Lyo supports unmarshalling various content types (RDF+XML, RDF+Abbreviated XML, Turtle notation, ...) and must decide which Unmarshaller to use. It does this based on the Content-Type of the response, which is sensible in my opinion.
if (contenttype == turtle) then turtleReader else defaultReader