Comments (7)
in some situations (such as being combined with rocket), the stream becomes useless as the entire data had to be written from the AsyncRead to accomplish this.
This should not happen as the http body stream in rocket framework does not include the leading new line, so multer-rs
will work with any Rust web framework.
In most of the cases, the http request body does not include the trailing new line. Are you using it in any customized http client?
from multer-rs.
This should not happen as the http body stream in rocket framework does not include the leading new line, so multer-rs will work with any Rust web framework.
yes, when a request is sent by rocket, this does not happen, the issue is when it receives it.
In most of the cases, the http request body does not include the trailing new line. Are you using it in any customized http client?
The client is an unmodified install of the Unity Web Request library, the data sent has those leading newlines;
using d.stream_to_file("AAAA").await.unwrap();
returned the file on the screenshot, with those leading newlines.
let mut d = data.open(1.megabytes()).stream_to_vec().await.unwrap();
d.remove(0);
d.remove(0);
let (stream, _) = get_stream_from_bytes(d).await;
this is the solution i went with, which downloads the entire thing into the vector, defeating the point of the initial stream.
from multer-rs.
Okay, got it, will fix it tomorrow and release a new version.
from multer-rs.
@rousan Do you have plans to release a new version with a fix for this issue?
from multer-rs.
Hey @nitsuga5124 @SergioBenitez, I am really sorry for slow response, actually, I got stuck in some other work lately. Can you please want to be a contributor? PR is welcome.
from multer-rs.
I already tried to look into PRing this, but i was unable to figure out a way to do it.
from multer-rs.
For reference, this paragraph from RFC 2046 section 5.1.1 seems relevant (emphasis mine).
There appears to be room for additional information prior to the
first boundary delimiter line and following the final boundary
delimiter line. These areas should generally be left blank, and
implementations must ignore anything that appears before the first
boundary delimiter line or after the last one.
It looks like implementing this may require adding an additional Stage
: currently Stage::ReadingBoundary
is used both before the first boundary and between fields, but additional data is only allowed before the first boundary.
I have some time this week to try this or another approach if nobody else is working on it.
from multer-rs.
Related Issues (20)
- The size limit should be `u64` rather than `usize` type.
- Use std::u64::MAX instead of u64::MAX as u64::MAX depends on rustc 1.43.0 HOT 1
- Unable to support utf8 file name HOT 8
- Support for async-std HOT 2
- Couldn't work with bytes 1.0 HOT 2
- Does this crate work with multipart/mixed ? HOT 1
- Consider allowing whitespaces after the boundary and before the CRLF HOT 1
- New release v2.0.0 ? HOT 6
- Remove `format!` allocations during parsing HOT 2
- Doesn't support 'name=' without double quotes
- Release 2.0.3 HOT 3
- Supporting unquoted name and filename broke semicolons in filenames HOT 1
- Clarify Field.name in relation to the RFC HOT 1
- support `filename*` HOT 3
- Not extracting `file_name` correctly if filename contains double quotes
- reading from stdin? HOT 4
- No release entry for v3.0.0 HOT 2
- StreamBuffer can use unlimied memory if the underlying stream is always ready HOT 3
- Provide accurate error information. HOT 5
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 multer-rs.