Coder Social home page Coder Social logo

Comments (5)

mworrell avatar mworrell commented on July 28, 2024

/cc @mmzeeman @arjan @kaos

from webzmachine.

mmzeeman avatar mmzeeman commented on July 28, 2024

Nice one :-) Some parts of webmachine desperately need a cleanup. This will make things more clear in this area.

Side note: There is a separate header for negotiating which transfer encoding to use. This is the TE header. Browsers generally don't send this header. This means that in the normal case identity and chunked are allowed, not gzip. Even if that is specified in the Accept-Encoding header. The Accept-Encoding header is restricted to specifying content encoding only. Proxies may add an TE header of course, but I don't think that is done in practice.

from webzmachine.

kaos avatar kaos commented on July 28, 2024

👍

from webzmachine.

mworrell avatar mworrell commented on July 28, 2024

The selected content-encoding/charset can be fetched with:

wrq:resp_content_encoding(ReqData).
wrq:resp_chosen_charset(ReqData).

There are some more new wrq functions:

resp_transfer_encoding/1, set_resp_transfer_encoding/2,
resp_content_encoding/1, set_resp_content_encoding/2,
resp_content_type/1, set_resp_content_type/2,
resp_chosen_charset/1, set_resp_chosen_charset/2,

See wrq.erl for more details.

Also added support for file:sendfile, and some new content return values, complete list is now:

iolist()
{device, IO}
{device, Length, IO}
{file, Filename}
{file Length, Filename}
{stream, StreamFun}
{stream, Size, StreamFun}
{writer, WriterFun}

from webzmachine.

mmzeeman avatar mmzeeman commented on July 28, 2024

That looks nice. I will place the same controller workflow inside the new elli + machine solution.

from webzmachine.

Related Issues (7)

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.