diff --git a/server/helpers.go b/server/helpers.go index c593da1..dda5705 100644 --- a/server/helpers.go +++ b/server/helpers.go @@ -103,7 +103,7 @@ func (p *Plugin) PopulateMeeting( var UrlEnd *url.URL UrlEnd, _ = url.Parse(callbackURL) - UrlEnd.Path += "/plugins/bigbluebutton/meetingendedcallback?" + m.MeetingID_ + "&" + m.ValidToken + UrlEnd.Path += "/plugins/bigbluebutton/meetingendedcallback/" + m.MeetingID_ + "/" + m.ValidToken Endmeetingcallback := UrlEnd.String() m.Meta_endcallbackurl = Endmeetingcallback diff --git a/server/responsehandlers.go b/server/responsehandlers.go index 7bcd6c1..929b41f 100644 --- a/server/responsehandlers.go +++ b/server/responsehandlers.go @@ -566,11 +566,17 @@ func (p *Plugin) handleJoinMeetingExternalUser(w http.ResponseWriter, r *http.Re // this method is responsible for updating meeting has ended inside mattermost when // we end our meeting from inside BigBlueButton. func (p *Plugin) handleImmediateEndMeetingCallback(w http.ResponseWriter, r *http.Request) { - startpoint := len("/meetingendedcallback?") - path := r.URL.Path - endpoint := strings.Index(path, "&") - meetingid := path[startpoint:endpoint] - validation := path[endpoint+1:] + pathComponents := strings.Split(r.URL.Path, "/") + + if len(pathComponents) != 4 { + p.API.LogError("incorrect meeting end callback URL encountered. URL: " + r.URL.String()) + http.Error(w, "incorrect meeting end callback URL encountered", http.StatusInternalServerError) + return + } + + validation := pathComponents[len(pathComponents)-1] + meetingid := pathComponents[len(pathComponents)-2] + meetingpointer := p.FindMeeting(meetingid) if meetingpointer == nil || meetingpointer.ValidToken != validation { http.Error(w, "Validation token mismatch", http.StatusForbidden) diff --git a/webapp/components/incoming_call/index.js b/webapp/components/incoming_call/index.js index 4034310..ba586cc 100644 --- a/webapp/components/incoming_call/index.js +++ b/webapp/components/incoming_call/index.js @@ -19,7 +19,6 @@ function mapDispatchTooProps(dispatch) { function mapStateToProps(state, ownProps) { const pluginState = getPluginState(state); return { - show: pluginState.incomingCall.dismissed === false, theme: getTheme(state), siteURL: state.entities.general.config.SiteURL, currentTeam: getTeam(state, getCurrentTeamId(state)),