Skip to content

Commit

Permalink
fix: index route; return the short URL instead of the original URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamza12700 committed Sep 12, 2024
1 parent 91814dd commit 38d4aae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions handlers/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ func Main(w http.ResponseWriter, r *http.Request) {
}

w.WriteHeader(http.StatusCreated)
w.Write([]byte(fmt.Sprintf("Location: %s\n", inputUrl)))
w.Write([]byte(fmt.Sprintf("Location: /u/%s", hashUrl)))
return
}

w.WriteHeader(http.StatusCreated)
w.Write([]byte(fmt.Sprintf("Location: %s\n", inputUrl)))
w.Write([]byte(fmt.Sprintf("Location: /u/%s", hashUrl)))
}

0 comments on commit 38d4aae

Please sign in to comment.