Skip to content

Commit

Permalink
fix: remove trim
Browse files Browse the repository at this point in the history
  • Loading branch information
appleboy committed Mar 3, 2017
1 parent 3bd9e8d commit d1071d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (issue *Issue) GetIsRead(userID int64) error {

// APIURL returns the absolute APIURL to this issue.
func (issue *Issue) APIURL() string {
return strings.TrimRight(issue.Repo.APIURL(), "/") + "/" + path.Join("issues", fmt.Sprint(issue.ID))
return issue.Repo.APIURL() + "/" + path.Join("issues", fmt.Sprint(issue.ID))
}

// HTMLURL returns the absolute URL to this issue.
Expand Down
2 changes: 1 addition & 1 deletion models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (repo *Repository) HTMLURL() string {

// APIURL returns the repository API URL
func (repo *Repository) APIURL() string {
return strings.TrimRight(setting.AppURL, "/") + "/" + path.Join("api/v1/repos", repo.FullName())
return setting.AppURL + path.Join("api/v1/repos", repo.FullName())
}

// APIFormat converts a Repository to api.Repository
Expand Down

0 comments on commit d1071d6

Please sign in to comment.