freerware / negotiator Goto Github PK
View Code? Open in Web Editor NEWA compact library for handling HTTP content negotiation for RESTful APIs.
Home Page: https://freerware.github.io/negotiator/
License: Apache License 2.0
A compact library for handling HTTP content negotiation for RESTful APIs.
Home Page: https://freerware.github.io/negotiator/
License: Apache License 2.0
Description
When receiving the list representation in the response of a 406 Not Acceptable
response during proactive negotiation, or in a response during reactive negotiation, the sourceQuality
is always 0
.
Steps to Reproduce
proactive
negotiation OR issue a request using reactive
negotiation.Expected Behavior
The sourceQuality
property should be set correctly.
Actual Behavior
freer > curl -K get_account.curl 127.0.0.1:8000/accounts/ea8123f6-f42c-4c3a-9a19-987229b42780 | jq .
HTTP/1.1 406 Not Acceptable
Content-Charset:
Content-Encoding:
Content-Language:
Content-Length: 824
Content-Type: application/json
Date: Tue, 07 Apr 2020 05:11:15 GMT
{
"representations": [
{
"contentType": "application/json",
"contentLanguage": "en-US",
"contentEncoding": [
"identity"
],
"contentLocation": "/accounts/ea8123f6-f42c-4c3a-9a19-987229b42780",
"contentCharset": "ascii",
"sourceQuality": 0
},
{
"contentType": "application/yaml",
"contentLanguage": "en-US",
"contentEncoding": [
"identity"
],
"contentLocation": "/accounts/ea8123f6-f42c-4c3a-9a19-987229b42780",
"contentCharset": "ascii",
"sourceQuality": 0
},
{
"contentType": "application/xml",
"contentLanguage": "en-US",
"contentEncoding": [
"identity"
],
"contentLocation": "/accounts/ea8123f6-f42c-4c3a-9a19-987229b42780",
"contentCharset": "ascii",
"sourceQuality": 0
},
{
"contentType": "application/json",
"contentLanguage": "en-US",
"contentEncoding": [
"gzip"
],
"contentLocation": "/accounts/ea8123f6-f42c-4c3a-9a19-987229b42780",
"contentCharset": "ascii",
"sourceQuality": 0
}
]
}
Versions
go version go1.12.9 linux/amd64
github.com/freerware/negotiator v0.1.0
Description
When receiving the list representation in the response of a 406 Not Acceptable
response during proactive negotiation, or in a response during reactive negotiation, the Content-*
headers are not set appropriately.
Steps to Reproduce
proactive
negotiation OR issue a request using reactive
negotiation.Expected Behavior
The following headers should be set appropriately:
Content-Charset
Content-Encoding
Content-Language
Actual Behavior
freer > curl -K get_account.curl 127.0.0.1:8000/accounts/ea8123f6-f42c-4c3a-9a19-987229b42780 | jq .
HTTP/1.1 406 Not Acceptable
Content-Charset:
Content-Encoding:
Content-Language:
Content-Length: 824
Content-Type: application/json
Date: Tue, 07 Apr 2020 05:11:15 GMT
{
"representations": [
{
"contentType": "application/json",
"contentLanguage": "en-US",
"contentEncoding": [
"identity"
],
"contentLocation": "/accounts/ea8123f6-f42c-4c3a-9a19-987229b42780",
"contentCharset": "ascii",
"sourceQuality": 0
},
{
"contentType": "application/yaml",
"contentLanguage": "en-US",
"contentEncoding": [
"identity"
],
"contentLocation": "/accounts/ea8123f6-f42c-4c3a-9a19-987229b42780",
"contentCharset": "ascii",
"sourceQuality": 0
},
{
"contentType": "application/xml",
"contentLanguage": "en-US",
"contentEncoding": [
"identity"
],
"contentLocation": "/accounts/ea8123f6-f42c-4c3a-9a19-987229b42780",
"contentCharset": "ascii",
"sourceQuality": 0
},
{
"contentType": "application/json",
"contentLanguage": "en-US",
"contentEncoding": [
"gzip"
],
"contentLocation": "/accounts/ea8123f6-f42c-4c3a-9a19-987229b42780",
"contentCharset": "ascii",
"sourceQuality": 0
}
]
}
Versions
go version go1.12.9 linux/amd64
github.com/freerware/negotiator v0.1.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.