Add cross-origin access on json interface#415
Open
Amygos wants to merge 2 commits into
Open
Conversation
Add header Access-Control-Allow-Origin on json interface for enable cross-origin HTTP requests. The presence of the header is determinate by "alloworigin" option, if the option is present and no vaule is specified the default vaule is "*". See also: https://developer.mozilla.org/docs/Web/HTTP/Headers/Access-Control-Allow-Origin and https://developer.mozilla.org/docs/Web/HTTP/CORS
wlanmac
reviewed
Jan 17, 2018
| _options.uamaliasname = STRDUP(args_info.uamaliasname_arg); | ||
| _options.uamhostname = STRDUP(args_info.uamhostname_arg); | ||
|
|
||
| if (args_info.alloworigin_given) |
Contributor
There was a problem hiding this comment.
I believe you want the if (...) statement in thee #ifdef
Author
There was a problem hiding this comment.
I leave the if (...) statement outside the #ifdef because if someone specify "alloworigin" option without json support will get a warning in syslog. I have mimic the behavior of other case like "proxylisten".
xOneca
reviewed
Jan 18, 2018
| _options.alloworigin = STRDUP(args_info.alloworigin_arg); | ||
| #endif | ||
| #if(_debug_ && !defined(ENABLE_JSON)) | ||
| syslog(LOG_WARNING, "JSON not implemented. build with --enable-json"); |
Contributor
There was a problem hiding this comment.
I would add to the message which option needs JSON support (i.e. alloworigin). And maybe better error than warn?
|
Anyone cares to explain, why this PR hasn't been accepted? |
|
Anything wrong with this pull request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.