Skip to content

Commit

Permalink
fix resourceAddress when search for subscription
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Ding <jackding@gmail.com>
  • Loading branch information
jzding committed Jul 30, 2024
1 parent e7a8771 commit 82c72d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v2/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,16 +454,16 @@ func (s *Server) getCurrentState(w http.ResponseWriter, r *http.Request) {
return
}

if !strings.HasPrefix(resourceAddress, "/") {
resourceAddress = fmt.Sprintf("/%s", resourceAddress)
}

eventSubscribers := s.subscriberAPI.GetClientIDAddressByResource(resourceAddress)
if len(eventSubscribers) == 0 {
respondWithStatusCode(w, http.StatusNotFound, fmt.Sprintf("subscription not found for %s", resourceAddress))
return
}

if !strings.HasPrefix(resourceAddress, "/") {
resourceAddress = fmt.Sprintf("/%s", resourceAddress)
}

// this is placeholder not sending back to report
out := channel.DataChan{
Address: resourceAddress,
Expand Down

0 comments on commit 82c72d7

Please sign in to comment.