Comments (6)
Also the base example is broken
from salvo.
Are you updated to latest version?
from salvo.
@chrislearn upgrading to the latest version causes tons of library bugs. Here is my cargo with the latest. I have to use 0.63.1.
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> /Users/oliverdixon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/salvo_core-0.65.1/src/test/response.rs:83:85
|
83 | let full = self.take_bytes(Some(&"application/json".parse().unwrap())).await?;
| ^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[u8]`
note: required by a bound in `Break`
--> /Users/oliverdixon/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/control_flow.rs:85:25
|
85 | pub enum ControlFlow<B, C = ()> {
| ^^^^^^ required by this bound in `Break`
...
93 | Break(B),
| ----- required by a bound in this variant
from salvo.
@chrislearn I upgraded Rust, but I got some new errors, not sure how to solve as there's no examples (still not solved the CORS issue)
from salvo.
@chrislearn thanks I fixed it. I just removed this code, seems to work without default source.
Just Rust update, and make sure to hoop at end of service.
Of course I wont' be using "*"
let cors = Cors::new()
.allow_origin("*")
.allow_methods(vec![Method::GET, Method::POST, Method::DELETE])
.allow_headers(AllowHeaders::list(vec![
HeaderName::from_static("content-type"),
HeaderName::from_static("authorization"),
HeaderName::from_static("device-id"),
]))
.into_handler();
let service = Service::new(router).hoop(cors);
Server::new(acceptor).serve(service).await;
from salvo.
If you are sure this is salvo bug. please give a minimal reproduce demo.
from salvo.
Related Issues (20)
- oapi 的 QueryParam 不支持 struct类型 HOT 2
- Can we make the `SendTarget` a public trait? HOT 2
- Why is `Service::handle` dose not pass the request local and remote addr to `Service::hyper_handler`?
- could not compile `salvo_core` (lib) - impl Trait` only allowed in function and inherent method return types, not in trait method return types HOT 1
- Cannot override non-schema type HOT 2
- 支持随机端口/support random port
- The https (using rustls or openssl) tls handshake is not 100% successful at high concurrency. HOT 2
- I noticed a massive use of unwrap() in Salvo source code (670 unwrap ) HOT 5
- Consider adding `fastwebsockets` as an option HOT 2
- Rustls backend loads only the first certificate from file HOT 2
- Enhancement Request: More Flexibility in Modifying Responses After Proxying
- 防御慢速HTTP攻击 HOT 2
- [FEATURE] Add default security values HOT 13
- sse stream时,客户端只返回最后的值 HOT 1
- Impossible to import TestClient and ResponseText HOT 3
- The `endpoint` macros documentation should point to the module `endpoint`
- [FEATURE] Easy print of error body
- How to add a header to proxy? HOT 1
- Redirect a PUT HOT 2
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 salvo.