Skip to content
Snippets Groups Projects
Commit f1eab971 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed suggestions parsing

parent 86c6ad87
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,9 @@ package bahn ...@@ -2,7 +2,9 @@ package bahn
import ( import (
"fmt" "fmt"
"io/ioutil"
"net/http" "net/http"
"strings"
"time" "time"
"net/url" "net/url"
...@@ -174,7 +176,15 @@ func (c *ApiClient) Suggestions(line string, date time.Time) ([]Suggestion, erro ...@@ -174,7 +176,15 @@ func (c *ApiClient) Suggestions(line string, date time.Time) ([]Suggestion, erro
return suggestions, err return suggestions, err
} }
if suggestions, err = SuggestionsFromReader(response.Body); err != nil { var content []byte
if content, err = ioutil.ReadAll(response.Body); err != nil {
return suggestions, err
}
strippedContent := string(content)
strippedContent = strings.TrimPrefix(strippedContent, "TSLs.sls = ")
strippedContent = strings.TrimSuffix(strippedContent, ";")
if suggestions, err = SuggestionsFromBytes([]byte(strippedContent)); err != nil {
return suggestions, err return suggestions, err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment