Comments (4)
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.
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.
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.
+1 for abstraction. Would love to see this feature. :)
from iron.
Related Issues (20)
- replace WriteBody with Into<Body>
- about "too many open file" HOT 4
- URL Parser Unable to Handle IPv6 Addresses HOT 1
- unable to build on nightly (2019-08-01) HOT 1
- Unable to build on nightly HOT 3
- iron::params not parsing query string parameters in 0.6.1 UrlEncodedQuery seems to work with same example. HOT 1
- Typo in documentation link (modifiers) HOT 2
- Keywords and categories in Cargo.toml
- question: Is this repo still in active development? HOT 3
- Unix Domain?
- Is iron Async/Await supported? HOT 1
- Iron::https uses Protocol::http on v0.6.1
- ironframework.io not resolving HOT 3
- ironframework.io serves malicious content HOT 5
- Tests error with latest Rust 1.49
- Is this project still maintained? HOT 2
- Add stale-while-revalidate to CacheDirective
- stop|restart an Iron server
- `req.url` stripping fragments? HOT 2
- Should this crate be used anymore ? HOT 1
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 iron.