Closed Benjy1979 closed 5 years ago
I've put a project showing simple program to reproduce the issue: Here is a repository
The application route has CreateRecord in it. It will use the plan adapter (as proven by the alert("Called this"); appearing in the application route).
It makes this request in chrome. I can see the x-access-token there look, but the content-type is not set.
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
Origin: http://localhost:4200
Referer: http://localhost:4200/
User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Mobile Safari/537.36
x-access-token: TOKENHERE
X-Requested-With: XMLHttpRequest
@Benjy1979 if you properly case to Content-Type
is it set?
No it stays the same
I think this will resolve it: https://github.com/emberjs/data/pull/6169
How do I get hold of the changes, I'm not too familiar with what I can do with that link. 1 of the tests are failing.
I normally just use ember-cli-update
@snewcomer was this fixed by #6341 ?
Yes it was! At least for the fetch
case - https://github.com/emberjs/data/pull/6341/files#diff-ad84fbc878beedc97078e5053b8e41d7R1102
For ajax
, it is relying on contentType
and shouldn't be blanking over it anymore!
Ah yes it is working now, my extended adapter for a particular model is reading the header callback and the request has the specified one in the request. Thrilled, and thanks very much.
Reproduction
Please provide one of the following:
Check POST in the model adapters of CreateRecord call.
Description
See this for description
Versions
Run the following command and paste the output below:
npm ls ember-source && npm ls ember-cli && npm ls ember-data
.P.S. If any of the packages show more than one installed version, that may be the root cause of the issue!
Thanks again!
The
ember-data
Team <3