Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-forum
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-forum
Commits
0efaf050
Commit
0efaf050
authored
Oct 07, 2016
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Implemented CORS for new-system-incident
parent
5599f7a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
intranet-forum-init.tcl
tcl/intranet-forum-init.tcl
+11
-0
intranet-forum-procs.tcl
tcl/intranet-forum-procs.tcl
+28
-0
new-system-incident.tcl
www/new-system-incident.tcl
+2
-0
No files found.
tcl/intranet-forum-init.tcl
0 → 100755
View file @
0efaf050
# /packages/intranet-forum/tcl/intranet-forum-procs.tcl
#
# Copyright (C
)
2003 - 2009
]
project-open
[
#
# All rights reserved. Please check
# http://www.project-open.com/license/ for details.
set
prefix
"/intranet-forum"
set
url
"
${prefix}
/*"
ns_register_proc OPTIONS
${url}
im_forum_handle_options
tcl/intranet-forum-procs.tcl
View file @
0efaf050
...
...
@@ -13,6 +13,34 @@ ad_library {
}
ad_proc -public im_forum_handle_options
{
uri method args
}
{
Dispatch request to the proper service contract implmentation
}
{
ns_log Notice
"im_forum_handle_options: uri=
$uri
, method=
$method
, args=
$args
"
eval im_forum_handle_options1
}
ad_proc -public im_forum_handle_options1
{
}
{
Handle AJAX CORS
"pre-flight"
request for headers.
This request comes with a HTTP
"OPTIONS"
verb.
}
{
set url
[
ns_conn url
]
ns_log Notice
"im_forum_handle_options1: url=
$url
"
set header_vars
[
ns_conn headers
]
set origin
[
ns_set get
$header
_vars
"Origin"
]
set request_headers
[
ns_set get
$header
_vars
"Access-Control-Request-Headers"
]
ns_set put
[
ns_conn outputheaders
]
"Access-Control-Allow-Methods"
"GET, POST"
ns_set put
[
ns_conn outputheaders
]
"Access-Control-Allow-Headers"
$request
_headers
ns_set put
[
ns_conn outputheaders
]
"Access-Control-Allow-Origin"
$origin
ns_return 200
"text/plain"
""
}
# ----------------------------------------------------------------------
# Select Boxes
# ----------------------------------------------------------------------
...
...
www/new-system-incident.tcl
View file @
0efaf050
...
...
@@ -38,6 +38,8 @@ ad_page_contract {
{
os_version
""
}
}
# Allow for CORS requests to this page
ns_set cput
[
ns_conn outputheaders
]
"Access-Control-Allow-Origin"
"*"
# -----------------------------------------------------------------
# Defaults & Security
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment