Git Product home page Git Product logo

Comments (7)

yakovkhalinsky avatar yakovkhalinsky commented on July 25, 2024

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.

yakovkhalinsky avatar yakovkhalinsky commented on July 25, 2024

I think if there is no good reason for us to set the character encoding we can take that line out 👍

from drakov.

gillesdemey avatar gillesdemey commented on July 25, 2024

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.

marcelogo avatar marcelogo commented on July 25, 2024

@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.

marcelogo avatar marcelogo commented on July 25, 2024

@gillesdemey

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.

gillesdemey avatar gillesdemey commented on July 25, 2024

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.

gillesdemey avatar gillesdemey commented on July 25, 2024

The fix is working, no more fails! 👍

from drakov.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.