Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
args: --features ${{ matrix.features }}
args: --features ${{ matrix.features }} --workspace

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --features ${{ matrix.features }}
args: --features ${{ matrix.features }} --workspace
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ brotli = { version = "3.3.2", optional = true }
chrono = { version = "0.4.19", default-features = false, features = ["clock"] }
filetime = "0.2.0"
deflate = { version = "1.0.0", optional = true, features = ["gzip"] }
rouille-multipart = { version = "0.18", path = "rouille-multipart", default-features = false, features = ["server"] }
rouille-multipart = { version = "0.19", path = "rouille-multipart", default-features = false, features = ["server"] }
percent-encoding = "2"
rand = "0.8"
serde = "1"
Expand Down
51 changes: 3 additions & 48 deletions rouille-multipart/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "rouille-multipart"
version = "0.18.0"
version = "0.19.0"
authors = ["Austin Bonander <austin.bonander@gmail.com>"]
description = "A backend-agnostic extension for HTTP libraries that provides support for POST multipart/form-data requests on both client and server."
keywords = ["form-data", "hyper", "iron", "http", "upload"]
keywords = ["form-data", "http", "upload"]
repository = "http://github.com/abonander/multipart"
documentation = "http://docs.rs/multipart/"
license = "MIT OR Apache-2.0"
Expand All @@ -12,7 +12,6 @@ autobins = false
edition = "2021"

[dependencies]
lazy_static = { version = "1.2.0", optional = true }
log = "0.4"
mime = "0.3.14"
mime_guess = "2.0.1"
Expand All @@ -28,57 +27,13 @@ twoway = { version = "0.1", optional = true }
quick-error = { version = "1.2", optional = true }

# Optional Integrations
hyper = { version = ">=0.9, <0.11", optional = true, default-features = false }
iron = { version = ">=0.4,<0.7", optional = true }
tiny_http = { version = "0.6", optional = true }
nickel = { version = ">=0.10.1", optional = true }

# Only for Rocket example but dev-dependencies can't be optional
rocket = { version = "0.4", optional = true }

[dev-dependencies]
env_logger = "0.5"

[features]
client = []
default = ["client", "hyper", "iron", "mock", "nickel", "server", "tiny_http"]
default = ["client", "mock", "server", "tiny_http"]
server = ["buffer-redux", "httparse", "quick-error", "safemem", "twoway"]
mock = []
nightly = []
bench = []

[[example]]
name = "hyper_client"
required-features = ["client", "mock", "hyper"]

[[example]]
name = "hyper_reqbuilder"
required-features = ["client", "mock", "hyper"]

[[example]]
name = "hyper_server"
required-features = ["mock", "hyper", "server"]

[[example]]
name = "iron"
required-features = ["mock", "iron", "server"]

[[example]]
name = "iron_intercept"
required-features = ["mock", "iron", "server"]

[[example]]
name = "nickel"
required-features = ["mock", "nickel", "server"]

[[example]]
name = "tiny_http"
required-features = ["mock", "tiny_http", "server"]

[[example]]
name = "rocket"
required-features = ["mock", "rocket", "server"]

[[bin]]
name = "form_test"
required-features = ["mock", "hyper", "server"]
27 changes: 0 additions & 27 deletions rouille-multipart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,11 @@ Look for a release of [multipart-async] soon which targets newer releases of Hyp

Example files demonstrating how to use `multipart` with these crates are available under [`examples/`](examples).

### [Hyper ![](https://img.shields.io/crates/v/hyper.svg)](https://crates.io/crates/hyper)
via the `hyper` feature (enabled by default).

**Note: Hyper 0.9, 0.10 (synchronous API) only**; support for asynchronous APIs will be provided by [multipart-async].

Client integration includes support for regular `hyper::client::Request` objects via `multipart::client::Multipart`, as well
as integration with the new `hyper::Client` API via `multipart::client::lazy::Multipart` (new in 0.5).

Server integration for `hyper::server::Request` via `multipart::server::Multipart`.

### [Iron ![](https://img.shields.io/crates/v/iron.svg)](https://crates.io/crates/iron)
via the `iron` feature.

Provides regular server-side integration with `iron::Request` via `multipart::server::Multipart`,
as well as a convenient `BeforeMiddleware` implementation in `multipart::server::iron::Intercept`.

### [Nickel ![](https://img.shields.io/crates/v/nickel.svg)](https://crates.io/crates/nickel) <sup>returning to `multipart` in 0.14!</sup>
via the `nickel` feature.

Provides server-side integration with `&mut nickel::Request` via `multipart::server::Multipart`.

### [tiny_http ![](https://img.shields.io/crates/v/tiny_http.svg)](https://crates.io/crates/tiny_http)
via the `tiny_http` feature.

Provides server-side integration with `tiny_http::Request` via `multipart::server::Multipart`.

### [Rocket ![](https://img.shields.io/crates/v/rocket.svg)](https://crates.io/crates/rocket)

Direct integration is not provided as the Rocket folks seem to want to handle `multipart/form-data`
behind the scenes which would supercede any integration with `multipart`. However, an example is available
showing how to use `multipart` on a Rocket server: [examples/rocket.rs](examples/rocket.rs)

## ⚡ Powered By ⚡

### [buf_redux ![](https://img.shields.io/crates/v/buf_redux.svg)](https://crates.io/crates/buf_redux)
Expand Down
93 changes: 0 additions & 93 deletions rouille-multipart/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,8 @@ These example files show how to use `multipart` with the various crates it integ

These files carry the same licenses as [`multipart` itself](https://github.com/abonander/multipart#license), though this may be lightened to a copyright-free license in the near future.

## Client

Examples for the client-side integrations of `multipart`'s API.

[`hyper_client`](hyper_client.rs)
---------------------------------
Author: [abonander]

This example showcases usage of `multipart` with the `hyper::client::Request` API.

```
$ cargo run --example hyper_client
```

[`hyper_reqbuilder`](hyper_reqbuilder.rs)
-----------------------------------------
Author: [abonander]

This example showcases usage of `multipart` with Hyper's new `Client` API,
via the lazy-writing capabilities of `multipart::client::lazy`.

```
$ cargo run --example hyper_reqbuilder
```

## Server

[`hyper_server`](hyper_server.rs)
---------------------------------
Author: [Puhrez]

This example shows how to use `multipart` with a [`hyper::Server`] (http://hyper.rs/) to intercept multipart requests.

```
$ cargo run --example hyper_server
```

[`iron`](iron.rs)
-----------------
Author: [White-Oak]

This example shows how to use `multipart` with the [Iron web application framework](https://github.com/iron/iron), via `multipart`'s support
for the `iron::Request` type.

To run:

```
$ cargo run --features iron --example iron
```

[`iron_intercept`](iron_intercept.rs)
-------------------------------------
Author: [abonander]

This example shows how to use `multipart`'s specialized `Intercept` middleware with Iron, which reads out all fields and
files to local storage so they can be accessed arbitrarily.

```
$ cargo run --features iron --example iron_intercept
```

[`tiny_http`](tiny_http.rs)
---------------------------
Author: [White-Oak]
Expand All @@ -76,40 +17,6 @@ This example shows how to use `multipart` with the [`tiny_http` crate](https://c
$ cargo run --features tiny_http --example tiny_http
```

[`hyper_server`](hyper_server.rs)
---------------------------------
Author: [Puhrez]

This example shows how to use `multipart` with a [`hyper::Server`] (http://hyper.rs/) to intercept multipart requests.

```
$ cargo run --example hyper_server
```

[`nickel`](nickel.rs)
---------------------
Author: [iamsebastian]

This example shows how to use `multipart` to handle multipart uploads in [nickel.rs](https://nickel.rs).

```
$ cargo run --example nickel --features nickel
```

[Rocket](rocket.rs)
-------------------
Author: [abonander]

This example shows how `multipart`'s server API can be used with [Rocket](https://rocket.rs) without
explicit support (the Rocket folks seem to want to handle `multipart/form-data` behind the scenes
but haven't gotten around to implementing it yet; this would supercede any integration from `multipart`).

```
$ cargo run --example rocket --features "rocket"
```

[iamsebastian]: https://github.com/iamsebastian
[Puhrez]: https://github.com/puhrez
[White-Oak]: https://github.com/white-oak
[abonander]: https://github.com/abonander

43 changes: 0 additions & 43 deletions rouille-multipart/examples/hyper_client.rs

This file was deleted.

19 changes: 0 additions & 19 deletions rouille-multipart/examples/hyper_reqbuilder.rs

This file was deleted.

51 changes: 0 additions & 51 deletions rouille-multipart/examples/hyper_server.rs

This file was deleted.

Loading
Loading