Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spr0cketeer
Icecast-Server
Commits
c7e355ce
Commit
c7e355ce
authored
Nov 04, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update: Improved CORS header handling regarding defaults
parent
f60791ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
src/util.c
src/util.c
+19
-2
No files found.
src/util.c
View file @
c7e355ce
...
...
@@ -630,9 +630,26 @@ static inline void _build_headers_loop(char **ret, size_t *len, const ice_conf
value
=
header
->
value
;
if
(
!
value
)
{
if
(
strcasecmp
(
name
,
"Access-Control-Allow-Origin"
)
==
0
)
{
value
=
origin
;
if
(
status
>=
200
&&
status
<=
299
)
{
value
=
origin
;
}
else
if
(
status
>=
400
&&
status
<=
599
)
{
value
=
"null"
;
}
else
{
/* do not set as we do not have a default for that. */
}
}
else
if
(
strcasecmp
(
name
,
"Access-Control-Allow-Methods"
)
==
0
)
{
value
=
allow
;
if
(
status
>=
200
&&
status
<=
299
)
{
/* only use the default if we are posive reply. */
value
=
allow
;
}
}
else
if
(
strcasecmp
(
name
,
"Access-Control-Expose-Headers"
)
==
0
)
{
value
=
"icy-br, icy-description, icy-genre, icy-name, icy-pub, icy-url"
;
}
else
if
(
strcasecmp
(
name
,
"Access-Control-Max-Age"
)
==
0
)
{
value
=
"300"
;
/* 300s = 5 minutes */
/* No default (yet)
* } else if (strcasecmp(name, "Access-Control-Allow-Credentials") == 0) {
* } else if (strcasecmp(name, "Access-Control-Allow-Headers") == 0) {
*/
}
}
}
...
...
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