Skip to content

Commit

Permalink
chore: Remove unsupported non-context endpoints (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 authored Nov 26, 2024
1 parent e26ee2f commit 4a0df94
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions mockld/polling_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ const (
PollingPathJSClientGet = "/sdk/evalx/{env}/contexts/{context}"
PollingPathJSClientReport = "/sdk/evalx/{env}/context"

// The following endpoint paths were used by older SDKs based on the user model rather than
// the context model. New context-aware SDKs should always use the new paths. However, our
// mock service still supports the old paths (just as the real LD services do). We have
// specific tests to verify that the SDKs use the new paths; in all other tests, if the SDK
// uses an old path, it will still work so that we don't confusingly see every test fail.
// We do *not* support the very old "eval" (as opposed to "evalx") paths since the only SDKs
// that used them are long past EOL.
PollingPathMobileGetUser = "/msdk/evalx/users/{context}"
PollingPathMobileReportUser = "/msdk/evalx/user"
PollingPathJSClientGetUser = "/sdk/evalx/{env}/users/{context}"
PollingPathJSClientReportUser = "/sdk/evalx/{env}/user"

PollingPathPHPAllFlags = "/sdk/flags"
PollingPathPHPFlag = "/sdk/flags/{key}"
PollingPathPHPSegment = "/sdk/segments/{key}"
Expand Down Expand Up @@ -70,14 +58,10 @@ func NewPollingService(
case MobileSDK:
router.Handle(PollingPathMobileGet, pollHandler).Methods("GET")
router.Handle(PollingPathMobileReport, pollHandler).Methods("REPORT")
router.Handle(PollingPathMobileGetUser, pollHandler).Methods("GET")
router.Handle(PollingPathMobileReportUser, pollHandler).Methods("REPORT")
// Note that we only support the "evalx", not the older "eval" which is used only by old unsupported SDKs
case JSClientSDK:
router.Handle(PollingPathJSClientGet, pollHandler).Methods("GET")
router.Handle(PollingPathJSClientReport, pollHandler).Methods("REPORT")
router.Handle(PollingPathJSClientGetUser, pollHandler).Methods("GET")
router.Handle(PollingPathJSClientReportUser, pollHandler).Methods("REPORT")
case PHPSDK:
router.Handle(PollingPathPHPFlag, p.phpFlagHandler()).Methods("GET")
router.Handle(PollingPathPHPSegment, p.phpSegmentHandler()).Methods("GET")
Expand Down

0 comments on commit 4a0df94

Please sign in to comment.