Skip to content

Commit

Permalink
... (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
bueti authored Dec 22, 2023
1 parent 687f16d commit e9a876d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/api/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"fmt"
"net/http"
url2 "net/url"
"os"
"path/filepath"
"strings"
Expand All @@ -19,7 +18,7 @@ import (

func (app *application) redirectUrlHandler(c echo.Context) error {
wildcardValue := c.Param("*")
shortUrl := url2.PathEscape(strings.TrimSuffix(wildcardValue, "/"))
shortUrl := strings.TrimSuffix(wildcardValue, "/")
url, err := app.models.Urls.GetRedirect(shortUrl)
if err != nil {
return c.JSON(http.StatusNotFound, err.Error())
Expand Down

0 comments on commit e9a876d

Please sign in to comment.