Codota Logo
CorsRegistration.allowedMethods
Code IndexAdd Codota to your IDE (free)

How to use
allowedMethods
method
in
org.springframework.web.reactive.config.CorsRegistration

Best Java code snippets using org.springframework.web.reactive.config.CorsRegistration.allowedMethods (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-framework

  @Override
  protected void addCorsMappings(CorsRegistry registry) {
    registry.addMapping("/cors-restricted")
        .allowedOrigins("http://foo")
        .allowedMethods("GET", "POST");
    registry.addMapping("/cors");
    registry.addMapping("/ambiguous")
        .allowedMethods("GET", "POST");
  }
}
origin: spring-projects/spring-framework

@Test
public void customizedMapping() {
  this.registry.addMapping("/foo").allowedOrigins("http://domain2.com", "http://domain2.com")
      .allowedMethods("DELETE").allowCredentials(false).allowedHeaders("header1", "header2")
      .exposedHeaders("header3", "header4").maxAge(3600);
  Map<String, CorsConfiguration> configs = this.registry.getCorsConfigurations();
  assertEquals(1, configs.size());
  CorsConfiguration config = configs.get("/foo");
  assertEquals(Arrays.asList("http://domain2.com", "http://domain2.com"), config.getAllowedOrigins());
  assertEquals(Arrays.asList("DELETE"), config.getAllowedMethods());
  assertEquals(Arrays.asList("header1", "header2"), config.getAllowedHeaders());
  assertEquals(Arrays.asList("header3", "header4"), config.getExposedHeaders());
  assertEquals(false, config.getAllowCredentials());
  assertEquals(Long.valueOf(3600), config.getMaxAge());
}
origin: Dromara/soul

  @Override
  public void addCorsMappings(final CorsRegistry registry) {
    registry.addMapping("/**")
        .allowedHeaders("Access-Control-Allow-Origin",
            "*",
            "Access-Control-Allow-Methods",
            "POST, GET, OPTIONS, PUT, DELETE",
            "Access-Control-Allow-Headers",
            "Origin, X-Requested-With, Content-Type, Accept")
        .allowedOrigins("*")
        .allowedMethods("*");
  }
}
origin: org.onap.ccsdk.apps.controllerblueprints/application

  @Override
  public void addCorsMappings(CorsRegistry corsRegistry) {
    corsRegistry.addMapping("/**")
        .allowedOrigins("*")
        .allowedMethods("*")
        .allowedHeaders("DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range")
        .maxAge(3600);
  }
}
origin: forcelate/forcelate-skeletons

  @Override
  public void addCorsMappings(CorsRegistry registry) {
    Cors cors = applicationProperties.getAppConfigs().getCors();
    if (cors.getEnabled()) {
      LOGGER.info("Spring MVC configuration: CORS mappings enabled");
      registry.addMapping(cors.getPathPattern())
          .allowedOrigins(cors.getAllowedOrigins())
          .allowedMethods(cors.getAllowedMethods())
          .exposedHeaders(cors.getExposedHeaders())
          .allowCredentials(cors.getAllowCredentials());
    } else {
      LOGGER.info("Spring MVC configuration: CORS mappings disabled");
    }
  }
};
org.springframework.web.reactive.configCorsRegistrationallowedMethods

Javadoc

Set the HTTP methods to allow, e.g. "GET", "POST", etc.

The special value "*" allows all methods.

By default "simple" methods GET, HEAD, and POSTare allowed.

Popular methods of CorsRegistration

  • allowedOrigins
    Set the origins to allow, e.g. "http://domain1.com".The special value "*" allows all domains. By de
  • allowedHeaders
    Set the list of headers that a pre-flight request can list as allowed for use during an actual reque
  • <init>
    Create a new CorsRegistration that allows all origins, headers, and credentials for GET, HEAD, and P
  • allowCredentials
    Whether user credentials are supported.By default this is set to true in which case user credentials
  • exposedHeaders
    Set the list of response headers other than "simple" headers, i.e. Cache-Control, Content-Language,
  • getCorsConfiguration
  • getPathPattern
  • maxAge
    Configure how long in seconds the response from a pre-flight request can be cached by clients.By def

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now