https://github.com/pzixel/test-actix-multipath
https://github.com/pzixel/test-actix-multipath
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pzixel/test-actix-multipath
- Owner: Pzixel
- License: mit
- Created: 2021-01-19T16:39:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-19T16:45:40.000Z (over 5 years ago)
- Last Synced: 2025-10-26T10:44:07.704Z (9 months ago)
- Language: Rust
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
Run two querties:
```bash
curl "http://localhost:8800/foo" --verbose
```
```bash
curl -X PUT "http://localhost:8800/foo" -d "{}" --verbose
```
See one o them working properly and another one failing with 405:
```bash
pzixe@ZPC MINGW64
$ curl "http://localhost:8800/foo" --verbose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying ::1:8800...
* Trying 127.0.0.1:8800...
* Connected to localhost (127.0.0.1) port 8800 (#0)
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0> GET /foo HTTP/1.1
> Host: localhost:8800
> User-Agent: curl/7.69.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< content-length: 0
< date: Tue, 19 Jan 2021 16:35:59 GMT
<
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Connection #0 to host localhost left intact
pzixe@ZPC MINGW64
$ curl -X PUT "http://localhost:8800/foo" -d "{}" --verbose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying ::1:8800...
* Trying 127.0.0.1:8800...
* Connected to localhost (127.0.0.1) port 8800 (#0)
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0> PUT /foo HTTP/1.1
> Host: localhost:8800
> User-Agent: curl/7.69.1
> Accept: */*
> Content-Length: 2
> Content-Type: application/x-www-form-urlencoded
>
} [2 bytes data]
* upload completely sent off: 2 out of 2 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 405 Method Not Allowed
< content-length: 0
< date: Tue, 19 Jan 2021 16:36:04 GMT
<
100 2 0 0 100 2 0 9 --:--:-- --:--:-- --:--:-- 9
* Connection #0 to host localhost left intact
```
Now if you change paths to
```rust
App::new()
.my_route(
"/foo",
web::get().to(|| HttpResponse::Ok().finish()),
)
.my_route(
"/foo1",
web::put().to(|| HttpResponse::Ok().finish()),
)
```
It suddently starts to work:
```bash
pzixe@ZPC MINGW64
$ curl "http://localhost:8800/foo" --verbose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying ::1:8800...
* Trying 127.0.0.1:8800...
* Connected to localhost (127.0.0.1) port 8800 (#0)
> GET /foo HTTP/1.1
> Host: localhost:8800
> User-Agent: curl/7.69.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< content-length: 0
< date: Tue, 19 Jan 2021 16:42:11 GMT
<
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Connection #0 to host localhost left intact
pzixe@ZPC MINGW64
$ curl -X PUT "http://localhost:8800/foo1" -d "{}" --verbose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying ::1:8800...
* Trying 127.0.0.1:8800...
* Connected to localhost (127.0.0.1) port 8800 (#0)
> PUT /foo1 HTTP/1.1
> Host: localhost:8800
> User-Agent: curl/7.69.1
> Accept: */*
> Content-Length: 2
> Content-Type: application/x-www-form-urlencoded
>
} [2 bytes data]
* upload completely sent off: 2 out of 2 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< content-length: 0
< date: Tue, 19 Jan 2021 16:42:17 GMT
<
100 2 0 0 100 2 0 9 --:--:-- --:--:-- --:--:-- 9
* Connection #0 to host localhost left intact
```