Changing URLs to GET for sharing

This commit is contained in:
Chris Sexton 2013-06-01 16:20:45 -04:00
parent a87835b54a
commit 11feafbee0
2 changed files with 2 additions and 2 deletions

View File

@ -456,7 +456,7 @@ func (p *FactoidPlugin) RegisterWeb() *string {
func (p *FactoidPlugin) serveQuery(w http.ResponseWriter, r *http.Request) {
context := make(map[string]interface{})
if e := r.PostFormValue("entry"); e != "" {
if e := r.FormValue("entry"); e != "" {
var entries []Factoid
p.Coll.Find(bson.M{"trigger": bson.M{"$regex": e}}).All(&entries)
context["Count"] = fmt.Sprintf("%d", len(entries))

View File

@ -11,7 +11,7 @@ var factoidIndex string = `
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.1.0/pure-min.css">
</head>
<div>
<form action="/factoid" method="POST" class="pure-form">
<form action="/factoid" method="GET" class="pure-form">
<fieldset>
<legend>Search for a factoid</legend>
<input type="text" name="entry" placeholder="trigger" value="{{.Search}}" />