4.1 KiB
4.1 KiB
Changelog
v2.1.3
- Remove Dialyzer PLTs from the Hex package. This has no functional impact whatsoever on the library. The PLTs were accidentally published together with the Hex package, which just results in an unnecessarily large Hex package.
v2.1.2
- Fix a bug with typespecs and Dialyzer.
v2.1.1
Bug fixes
- Fix a small issue with preflight requests and the
:passthrough_non_cors_requestsoption. - Add the
Corsica.options/0type.
v2.1.0
Improvements
- Add the
:passthrough_non_cors_requestsoption. - Add the
Corsica.sanitized_options/0andCorsica.options/0types.
v2.0.0
Breaking changes
- The
:originsoption is now required. Not having this option used to warn before this version. - The
:logoption was removed in favor ofCorsica.Telemetry.
Improvements
- Start emitting Telemetry events (see
Corsica.Telemetry). - Bump Elixir requirement to 1.11+.
- Response headers that contain lists (such as
access-control-expose-headers) are now joined without spaces, so what could beGET, POST, DELETEbefore is nowGET,POST,DELETE. Every byte's important.
Upgrading from 1.x to 2.0.0 is a matter of these things:
-
If you're not specifying the
:originsoptions when using Corsica, addorigins: "*"to all the places you're using Corsica (as a plug, throughCorsica.Router, or through the functions in theCorsicamodule). -
If you were using the
:logoption, remove it and call this in your application'sstart/2callback:log_levels = # what you were using before as the :log option Corsica.Telemetry.attach_default_handler(log_levels: log_levels) Supervisor.start_link(...)
v1.3.0
Improvements
- Add support for the
:allow_private_networkoption to control theAccess-Control-Allow-Private-Networkheader. - Fix runtime warnings for the
:warnlogger level.
v1.2.0
This version drops support for Elixir 1.7 and lower.
Improvements
- Add support for
{module, function, args}as a value for the:originsoption.
v1.1.3
Bug fixes
- Send the
vary: originheader when the origin is not*. We were doing this in some cases before but we missed a handful of other cases. See https://github.com/whatyouhide/corsica/pull/45.
v1.1.2
Improvements
- Drop the cowboy dependency completely (see #40).
v1.1.0
Improvements
- Warn if the
:originsoption is not explicitly provided. This warning will become an error in future Corsica versions.
v1.1.0
Bug fixes
- Correctly allow "simple methods" and "simple headers" in preflight requests. See the documentation for the
:allow_methodsand:allow_headersoptions.
Improvements
- Allow
:allas value for the:allow_methodsand:allow_headersoptions.
v1.0.0
Breaking changes
- Drop support for older Elixir versions and require Elixir
~> 1.3.
Improvements
- Improve logs.
v0.5.0
Breaking changes
- Drop support for anonymous functions in the list of
:origins(it was a mistake to support that in the first place!). - Change the
:logoption from being a log level orfalseto being a keyword list with log levels orfalsefor each log "type" (for example,:rejectedor:invalid).
Improvements
- Add support for
{module, function}tuples in the list of:origins(module.functionwill be called with the origin as its argument and will decide if such origin is allowed).
v0.4.2
Bug fixes
- Fix a bug where options given to a
Corsica.Routerweren't properly escaped and caused a "invalid quoted expression" error.
v0.4.1
Bug fixes
- Fix a typo in a logged message.
v0.4.0
Improvements
- Logging is now more detailed (for example, it logs what header is missing from
:allow_headers). - Accept options when a module calls
use Corsica.Routerand make these options overridable in eachCorsica.Router.resource/1-2macro.
v0.3.0
Improvements
- Add support for logging.