Skip to content

Commit

Permalink
Merge pull request yahoo#26 from buglloc/form-urls
Browse files Browse the repository at this point in the history
Fixed a forms url builder
  • Loading branch information
yukinying committed Jan 7, 2016
2 parents 4cbe82a + bbfbcb6 commit 504e7a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion renderer/phantomjs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"os/exec"
"reflect"
Expand Down Expand Up @@ -129,7 +130,11 @@ func (f *form) toScan(parent *gryffin.Scan) *gryffin.Scan {
if m == "POST" {
r = ioutil.NopCloser(strings.NewReader(f.Data))
} else {
u += "&" + f.Data
parsed, err := url.Parse(u)
if err == nil {
parsed.RawQuery = f.Data
u = parsed.String()
}
}

if req, err := http.NewRequest(m, u, r); err == nil {
Expand Down

0 comments on commit 504e7a9

Please sign in to comment.