From a10c90a51705942f7ff1e59a7f809ed0fd11ce52 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Tue, 17 Sep 2019 16:49:12 -0600 Subject: [PATCH] docs(README): Update default settings --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 80020df..d47399d 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,18 @@ The following is the default configuration. ``` settings = { autoRegisterInterceptor = true, - - allowOrigins = "*", - allowMethods = [ "DELETE", "GET", "PATCH", "POST", "PUT", "OPTIONS" ], - allowHeaders = [ "Content-Type", "X-Auth-Token", "Origin", "Authorization" ], + allowOrigins = function( event ) { + return event.getHTTPHeader( "Origin", "*" ); + }, + allowMethods = function( event ) { + return event.getHTTPMethod(); + }, + allowHeaders = function( event ) { + return event.getHTTPHeader( "Access-Control-Request-Headers", "" ); + }, maxAge = 60 * 60 * 24, // 1 day allowCredentials = true, - eventPattern = [ "^Main\.ajax$", "api" ] + eventPattern = ".*" }; ```