Skip to content

Commit

Permalink
Trimming the final return carriage
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Feb 15, 2024
1 parent fd5f077 commit 67b5a58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/views/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func (v *Views) StatusFunc(c echo.Context) error {
}

var forwarderStatus commonTransporter.ForwarderStatusResponse
forwarderStatus.Streams = map[string]string{}

err = mapstructure.Decode(response.Payload, &forwarderStatus)
if err != nil {
Expand All @@ -163,8 +164,7 @@ func (v *Views) StatusFunc(c echo.Context) error {
}

if len(forwarderStatus.Website) > 0 {
tempResp := response.Payload.(string)
tempRespArr := strings.Split(tempResp, "\r")
tempRespArr := strings.Split(strings.TrimRight(response.Payload.(string), "\r"), "\r")
var individualResponse StatusResponseIndividual
if len(tempRespArr) == 0 {
individualResponse = StatusResponseIndividual{
Expand All @@ -185,7 +185,7 @@ func (v *Views) StatusFunc(c echo.Context) error {
}

for index, streamOut := range forwarderStatus.Streams {
tempRespArr := strings.Split(streamOut, "\r")
tempRespArr := strings.Split(strings.TrimRight(streamOut, "\r"), "\r")
var individualResponse StatusResponseIndividual
if len(tempRespArr) == 0 {
individualResponse = StatusResponseIndividual{
Expand Down

0 comments on commit 67b5a58

Please sign in to comment.