Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

Encoding forced to application/json #47

Open
EdNutting opened this issue Feb 7, 2018 · 2 comments
Open

Encoding forced to application/json #47

EdNutting opened this issue Feb 7, 2018 · 2 comments

Comments

@EdNutting
Copy link

EdNutting commented Feb 7, 2018

Hi,

This line of code unintentionally forces the encoding of all links to be "application/json".

return new document.Link(url, method, 'application/json', fields, title, description)

I think what was intended was additional code for determining the encoding from the data and defaulting to application/json if necessary:

var encoding = getString(data, 'encoding') || 'application/json';
...
return new document.Link(_url, method, encoding, fields, _title, _description);

Hope this helps,
Ed

@Tanimodori
Copy link

Tanimodori commented Oct 7, 2018

After debugging for 10 minutes I ended up with the same issue. A fixed codec may be a workaround.

@EdNutting
Copy link
Author

(Note that the lines of code I quoted second were a sufficient/complete fix for my purposes)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants