Closed CxRes closed 1 year ago
The reason is that your example is passing in the wrong object for request, at least how our module is currently implemented. We probably need to improve our documentation. The request is expected to be this object: https://nodejs.org/dist/latest-v18.x/docs/api/http.html#class-httpincomingmessage
Thanks for a quick response! Is there any way, I can directly provide the Accept headers to Negotiator? I would prefer not to create a Node specific object (at least not use node in-builts).
It is a todo. Right now, the best is like the following:
negotiator = new Negotiator({
{ headers: { accept: 'some/mime' } }
})
The header names are expected to be lower case since that is the Node.js API, but you don't need to construct any objects other than plain ones.
I suppose that's good enough for now ... Thank you!
I am baffled why this is happening, but
negotiator.mediaType()
is returning*/*
. Here is my test code:The output should be
['text/turtle']
but it is['*/*']
. What's happening?Node: v18.13.0 OS: Windows 10 x64