Code Monkey home page Code Monkey logo

Comments (4)

zzmp avatar zzmp commented on May 22, 2024

This is a limitation from rust-http, which requires that all headers be written before any of the body. If you look at the source, the headers are flushed when any of the body is first written, and are then never written again.

I think there is some documentation of this in the cookie module, but you're right in that it should be more clear. Feel free to add to the documentation, or we will get to it soon.

from iron.

reem avatar reem commented on May 22, 2024

Yes, unfortunately once you have written to the body you can no longer write any headers. Until we get around to creating our own abstraction layer over rust-http's Request objects or switch to a new backend this isn't something we can support. :/

from iron.

reem avatar reem commented on May 22, 2024

We should really have some sort of error mechanism for detecting this case and warning you, so that it doesn't just silently fail.

from iron.

msierks avatar msierks commented on May 22, 2024

+1 for abstraction. Would love to see this feature. :)

from iron.

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.