Skip to content

Commit

Permalink
urban: URL escape word
Browse files Browse the repository at this point in the history
  • Loading branch information
godwhoa committed Nov 16, 2018
1 parent 8fc10dd commit 0ac5ca2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/urban/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"net/http"
"net/url"
"strings"

u "github.com/godwhoa/oodle/utils"
Expand Down Expand Up @@ -44,7 +45,7 @@ func format(def definition) string {
var ErrNoDefinition = errors.New("No definition found.")

func define(word string) (string, error) {
response, err := http.Get("https://api.urbandictionary.com/v0/define?term=" + word)
response, err := http.Get("https://api.urbandictionary.com/v0/define?term=" + url.QueryEscape(word))
if err != nil {
return "", err
}
Expand Down

0 comments on commit 0ac5ca2

Please sign in to comment.