Comments (7)
Good question @gillesdemey there's requirement to set the charset in the response.
Just curious, may I ask why you are running Dredd against Drakov?
from drakov.
I think if there is no good reason for us to set the character encoding we can take that line out 👍
from drakov.
No particular reason, I just wanted to give Dredd a try and I didn't want to create an express application — so Drakov seemed like the perfect solution :)
from drakov.
@gillesdemey We have removed the encoding from the request. Turns out, however, that Express implicitly adds a the default character encoding on all responses if it is not specified.
Perhaps this is something which Dredd should not enforce on this particular header.
We are going to do a spike in here but we are not sure if it is something Drakov could address.
from drakov.
We figured out that Express explicitly sets the charset to utf-8
. https://github.com/strongloop/express/blob/master/lib/response.js#L148
Even when the response body is an object. It converts it to string and call send again.
https://github.com/strongloop/express/blob/master/lib/response.js#L233
As we understand that Drakov must strictly follow what is defined in the blueprint file, we decided to handle it and we have pushed a fix to this scenario. 9a49bc8
It should address your situation with Dredd.
Let us know how it goes.
from drakov.
I'll check it out again tonight and I'll let you know.
I didn't know that Express actually looked at the response body type, interesting :)
Thanks for all the effort you've put into this, even though I understand that the use-case is pretty weird.
from drakov.
The fix is working, no more fails! 👍
from drakov.
Related Issues (20)
- Express server callback is not called after switching to 'drafter' HOT 1
- Discover option does not work HOT 1
- Incompatibility with body-parser HOT 3
- Remove Wiki tab HOT 1
- Can not match body request when Content-Type is x-www-form-urlencoded HOT 2
- URI conflict HOT 2
- Could not load the Visual C++ component "VCBuild.exe". To fix this HOT 2
- CLI option `--ignoreHeader` causes error HOT 1
- Missing URI parameters on mock advanced API Blueprint resources HOT 4
- stealthmode does not disable all output HOT 1
- Error on ignoreHeader command line argument HOT 3
- Docker HOT 1
- Send parameter value in body
- Dump all request data
- Share the project with community HOT 12
- ignoreHeader error, TypeError: ignoreHeaders.map is not a function HOT 1
- Add package-lock.json to the repo
- Use release-it for release/distribution
- public option not working HOT 5
- "Endpoint not found"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drakov.