mirror of
https://github.com/woodchen-ink/random-api-go.git
synced 2025-07-18 05:42:01 +08:00
fix(handlers): add HTTP redirect for API requests
- Implemented an HTTP redirect to a random URL in the HandleAPIRequest function, enhancing user experience by guiding users to the appropriate resource after processing their request.
This commit is contained in:
parent
80d18f2b88
commit
d6fd055cd5
@ -136,6 +136,8 @@ func (h *Handlers) HandleAPIRequest(w http.ResponseWriter, r *http.Request) {
|
||||
randomURL,
|
||||
)
|
||||
|
||||
http.Redirect(w, r, randomURL, http.StatusFound)
|
||||
|
||||
done <- struct{}{}
|
||||
}()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user