Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
Libraries
pistache
Commits
6b43f157
Commit
6b43f157
authored
Aug 28, 2018
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Access-Control-Allow-Headers to the set of headers
parent
b6491159
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
include/pistache/http_header.h
include/pistache/http_header.h
+26
-0
src/common/http_header.cc
src/common/http_header.cc
+10
-0
src/common/http_headers.cc
src/common/http_headers.cc
+1
-0
No files found.
include/pistache/http_header.h
View file @
6b43f157
...
...
@@ -186,6 +186,32 @@ private:
std
::
string
uri_
;
};
class
AccessControlAllowHeaders
:
public
Header
{
public:
NAME
(
"Access-Control-Allow-Headers"
)
AccessControlAllowHeaders
()
{
}
explicit
AccessControlAllowHeaders
(
const
char
*
val
)
:
val_
(
val
)
{
}
explicit
AccessControlAllowHeaders
(
const
std
::
string
&
val
)
:
val_
(
val
)
{
}
void
parse
(
const
std
::
string
&
data
);
void
write
(
std
::
ostream
&
os
)
const
;
void
setUri
(
std
::
string
val
)
{
val_
=
std
::
move
(
val
);
}
std
::
string
val
()
const
{
return
val_
;
}
private:
std
::
string
val_
;
};
class
CacheControl
:
public
Header
{
public:
NAME
(
"Cache-Control"
)
...
...
src/common/http_header.cc
View file @
6b43f157
...
...
@@ -432,6 +432,16 @@ AccessControlAllowOrigin::write(std::ostream& os) const {
os
<<
uri_
;
}
void
AccessControlAllowHeaders
::
parse
(
const
std
::
string
&
data
)
{
val_
=
data
;
}
void
AccessControlAllowHeaders
::
write
(
std
::
ostream
&
os
)
const
{
os
<<
val_
;
}
void
EncodingHeader
::
parseRaw
(
const
char
*
str
,
size_t
len
)
{
if
(
!
strncasecmp
(
str
,
"gzip"
,
len
))
{
...
...
src/common/http_headers.cc
View file @
6b43f157
...
...
@@ -26,6 +26,7 @@ namespace {
RegisterHeader
(
Accept
);
RegisterHeader
(
AccessControlAllowOrigin
);
RegisterHeader
(
AccessControlAllowHeaders
);
RegisterHeader
(
Allow
);
RegisterHeader
(
CacheControl
);
RegisterHeader
(
Connection
);
...
...
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