Comments (1)
You can add a cors header to the response like this for now —
val app = Http.collect[Request] {
case _ => Response.http(Status.ok, List(Header.custom("Access-Control-Allow-Origin", "*"))
}
Maybe later we could make it a bit shorter (and more performant)
val app = Http.collect[Request] {
case _ => Response.http(Status.ok, List(Header.accessControlAllowOrigin("*"))
}
Or even simpler something like —
val app = Http.collect[Request] {
case _ => Response.http(Status.ok).cors("*")
}
from zio-http.
Related Issues (20)
- timeout doesn't cancel correctly the HTTP client call HOT 5
- Handling streaming upload with multipart-form data fails with payloads greater than ~7KB HOT 5
- 3.0.0-RC7 regression when enabling compression serving static content HOT 3
- The `serveDirectory` middleware sends JS files as `application/javascript` (3.0.0-RC7) HOT 5
- circularity in docs HOT 7
- [gen] Concrete subtypes of a sum type referenced directly without nesting or proper import
- Add access to Env in error handler HOT 3
- Serving static files with SSL does not work HOT 4
- Code Generator that generates `.http` files from EndpointAPI HOT 6
- Fix CI HOT 6
- Replace Endpoint middleware concept with Security concept HOT 7
- [gen] the codegen from openapi does not respect additionalProperties which is how open products (maps/dictionaries) are defined HOT 8
- java.net.ConnectException finishConnect(..) failed when upgrading to zio-http 3.x HOT 13
- Regression - Netty Connection Exceptions with Large Connection Pool Count HOT 4
- Add a hybrid `RequestStreaming` option that streams requests only if they're larger than X bytes
- Allow users to be able to toggle ignoreEmptyCollections when returning JSON from their Endpoints HOT 5
- OpenAPI generation fails with a Map[String, List[String]]
- HttpContentCodec drops an empty list field from resulting json so it is a cause for parsers to fail on the client side HOT 1
- [openapi] fromEndpoints fail with an unexpected None.get
- Accept Routes with arbitrary error type in `PathCodec#/`
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 zio-http.