You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The BasicResponseWriter errors when it receives non-binary data, so we should make sure this never happens. Currently it can still happen with an */* accept header if the backend returns a stream of Quads.
What I suggest here is a default expansion of the Accept header. Basically, a text/turtle=0.01 can be added silently, if no text/* or text/turtle occurs in the request.
So perhaps an optional setting of defaultContentType to the header parser?
This woul be a fix for the demo, but the problem with this solution is that it would also convert json-ld documents if no Accept header was given, and I think we always want to return the original input document if no change is requested.
In my opinion the most correct solution would convert data somewhere between the DataAccessor and the ResponseWriter if a) the data has content-type internal/quads and b) this is not one of the requested types in the preferences. So we only pass around quads if it has been specifically requested.
Activity
RubenVerborgh commentedon Oct 21, 2020
RubenVerborgh commentedon Nov 3, 2020
What I suggest here is a default expansion of the
Acceptheader. Basically, atext/turtle=0.01can be added silently, if notext/*ortext/turtleoccurs in the request.So perhaps an optional setting of
defaultContentTypeto the header parser?jvherweg commentedon Nov 4, 2020
This woul be a fix for the demo, but the problem with this solution is that it would also convert json-ld documents if no Accept header was given, and I think we always want to return the original input document if no change is requested.
In my opinion the most correct solution would convert data somewhere between the DataAccessor and the ResponseWriter if a) the data has content-type
internal/quadsand b) this is not one of the requested types in the preferences. So we only pass around quads if it has been specifically requested.