-
Notifications
You must be signed in to change notification settings - Fork 10
fix: Adjust payload format for PHP endpoints #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| router.Handle("/all", GetProjectKeyFromAuthorizationHeader(http.HandlerFunc(StreamServerAllPayload))) | ||
|
|
||
| router.PathPrefix("/sdk/flags/{flagKey}"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GetServerFlags method already has a branch of logic that handles the individual flag request if the flagKey variable is set. However, we never defined that route so the variable would in fact get set.
| } | ||
| } else { | ||
| body = ServerAllPayloadFromFlagsState(allFlags) | ||
| body = ServerFlagsFromFlagsState(allFlags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For PHP, the /sdk/flags endpoint should return only the flags in an array, not the full flags + segments payload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait a sec. Will this break non-php sdks? I think we need this to have a 3rd case where we do just flags and not all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this is a problem. This function only serves two routes -- /sdk/flags/{flagKey} and /sdk/flags.
These are routes that should exclusively be used by PHP SDKs. Non-PHP SDKs don't make flag only requests such as these.
I think we need this to have a 3rd case where we do just flags and not all?
Line 25 is serves all flags. Line 20 serves a single flag (assuming the flag key parameter is set).
The /all endpoint is serviced by the StreamServerAllPayload handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The /all endpoint is serviced by the StreamServerAllPayload handler.
Ahhh, OK. Cool. I forgot about that.
mike-zorn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
No description provided.