Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
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
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-SMF
Commits
9b038d9a
Commit
9b038d9a
authored
Sep 22, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add content-type header for CreateSMContext Response
parent
d5b39aa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/api-server/smf-http2-server.cpp
src/api-server/smf-http2-server.cpp
+8
-4
No files found.
src/api-server/smf-http2-server.cpp
View file @
9b038d9a
...
...
@@ -392,17 +392,21 @@ void smf_http2_server::create_sm_contexts_handler(
Logger
::
smf_api_server
().
debug
(
"Got result for promise ID %d"
,
promise_id
);
nlohmann
::
json
json_data
=
{
};
sm_context_response
.
get_json_data
(
json_data
);
//Add header
header_map
h
;
//Location header
if
(
sm_context_response
.
get_smf_context_uri
().
size
()
>
0
)
{
Logger
::
smf_api_server
().
debug
(
"Add location header %s"
,
sm_context_response
.
get_smf_context_uri
().
c_str
());
header_map
h
;
h
.
emplace
(
"location"
,
header_value
{
sm_context_response
.
get_smf_context_uri
().
c_str
()
});
response
.
write_head
(
sm_context_response
.
get_http_code
(),
h
);
}
else
{
response
.
write_head
(
sm_context_response
.
get_http_code
());
}
//content-type header
h
.
emplace
(
"content-type"
,
header_value
{
"application/json"
});
response
.
write_head
(
sm_context_response
.
get_http_code
(),
h
);
response
.
end
(
json_data
.
dump
().
c_str
());
}
...
...
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