Skip to content

Commit

Permalink
fixed values
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfox675 committed Oct 22, 2021
1 parent 4c7f30b commit 9e4dff7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/index.js.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@ function handler(event) {
// Since JavaScript doesnt allow for hyphens in variable names, we use the dict["key"] notation
//Set new headers
var addAccessControlAllowOrigin = ${add_access_control_allow_origin}
if ( ${add_access_control_allow_origin} == true ) {
headers['access-control-allow-origin'] = [{key: 'Access-Control-Allow-Origin', value: '${access_control_allow_origin_value}'}];
if ( addAccessControlAllowOrigin ) {
headers['access-control-allow-origin'] = { value: '${access_control_allow_origin_value}'};
}
var addAccessControlAllowMethods = ${add_access_control_allow_methods}
if (addAccessControlAllowMethods) {
headers['access-control-allow-methods'] = [{key: 'Access-Control-Allow-Methods', value: '${access_control_allow_methods_value}'}];
headers['access-control-allow-methods'] = { value: '${access_control_allow_methods_value}'};
}
var addStrictTransportSecurity = ${add_strict_transport_security}
if (addStrictTransportSecurity) {
headers['strict-transport-security'] = [{key: 'Strict-Transport-Security', value: '${strict_transport_security_value}'}];
headers['strict-transport-security'] = { value: '${strict_transport_security_value}'};
}
var addContentSecurityPolicy = ${add_content_security_policy}
if (addContentSecurityPolicy) {
headers['content-security-policy'] = [{key: 'Content-Security-Policy', value: "${content_security_policy_value}"}];
headers['content-security-policy'] = { value: "${content_security_policy_value}"};
}
var addXContentTypeOptions = ${add_x_content_type_options}
if (addXContentTypeOptions) {
headers['x-content-type-options'] = [{key: 'X-Content-Type-Options', value: '${x_content_type_options_value}'}];
headers['x-content-type-options'] = { value: '${x_content_type_options_value}'};
}
var addXFrameOptions = ${add_x_frame_options}
if (addXFrameOptions) {
headers['x-frame-options'] = [{key: 'X-Frame-Options', value: '${x_frame_options_value}'}];
headers['x-frame-options'] = { value: '${x_frame_options_value}'};
}
var addXXssProtection = ${add_x_xss_protection}
if (addXXssProtection) {
headers['x-xss-protection'] = [{key: 'X-XSS-Protection', value: '${x_xss_protection_value}'}];
headers['x-xss-protection'] = { value: '${x_xss_protection_value}'};
}
var addReferrerPolicy = ${add_referrer_policy}
if (addReferrerPolicy) {
headers['referrer-policy'] = [{key: 'Referrer-Policy', value: '${referrer_policy_value}'}];
headers['referrer-policy'] = { value: '${referrer_policy_value}'};
}
var addFeaturePolicy = ${add_feature_policy}
if (addFeaturePolicy) {
headers['feature-policy'] = [{key: 'Feature-Policy', value: '${feature_policy_value}'}];
headers['feature-policy'] = { value: '${feature_policy_value}'};
}

// Return the response to viewers
Expand Down

0 comments on commit 9e4dff7

Please # to comment.