Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

io.wtsky.dropwizard:dropwizard-cors

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io.wtsky.dropwizard:dropwizard-cors

Provides support for configuring CORS headers.

  • 0.2
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Dropwizard CORS

Build Status Maven Central GitHub license

dropwizard-cors is a convenience library that enables easy configuration of Cross-Origin Resource Sharing related parameters.

Usage

Your configuration class needs a CorsBundleConfiguration instance:

public class ExampleConfiguration extends Configuration {
    @Valid
    @NotNull
    private CorsBundleConfiguration cors = new CorsBundleConfiguration();

    @JsonProperty("cors")
    public CorsBundleConfiguration getCorsConfiguration() {
        return cors;
    }

    @JsonProperty("cors")
    public void setCorsConfiguration(CorsBundleConfiguration cors) {
        this.cors = cors;
    }
}

Then, in your application's initialize method, add a new CorsBundle subclass:

@Override
public void initialize(Bootstrap<ExampleConfiguration> bootstrap) {
    bootstrap.addBundle(new CorsBundle<ExampleConfiguration>() {
        @Override
        public CorsBundleConfiguration getCorsConfiguration(ExampleConfiguration configuration) {
            return configuration.getCorsConfiguration();
        }
    });
}

Maven Artifacts

This project is available on Maven Central. To add it to your project simply add the following dependencies to your pom.xml:

<dependency>
    <groupId>io.wtsky.dropwizard</groupId>
    <artifactId>dropwizard-cors</artifactId>
    <version>0.2</version>
</dependency>

Support

Please file bug reports and feature requests in GitHub issues.

License

Copyright (c) 2020 Whitesky Communications, LLC

This library is licensed under the BSD 2-Clause "Simplified" License.

See the LICENSE file in this repository for the full license text.

FAQs

Package last updated on 08 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc