message: Fixed. redirect_url encode
diff: package controller
  import (
  + "bytes"
  "context"
  "crypto/rsa"
  "encoding/base64"
  @@ -11,6 +12,8 @@ import (
  "net/url"
  + "sort"
  +
  "github.com/cam-inc/dmc/example-go/common"
  "github.com/cam-inc/dmc/example-go/gen/app"
  "github.com/cam-inc/dmc/example-go/models"
  @@ -91,6 +94,27 @@ func generateJwt(customClaims map[string]interface{}, privateKey *rsa.PrivateKey
  return token.SignedString(privateKey)
  }
  +func encode(v url.Values) string {
  + var buf bytes.Buffer
  + keys := make([]string, 0, len(v))
  + for k := range v {
  + keys = append(keys, k)
  + }
  + sort.Strings(keys)
  + for _, k := range keys {
  + vs := v[k]
  + prefix := url.PathEscape(k) + "="
  + for _, v := range vs {
  + if buf.Len() > 0 {
  + buf.WriteByte('&')
  + }
  + buf.WriteString(prefix)
  + buf.WriteString(url.PathEscape(v))
  + }
  + }
  + return buf.String()
  +}
  +
  // NewAuthController creates a auth controller.
  func NewAuthController(service *goa.Service) *AuthController {
  b := common.GetPrivateKey()
  @@ -249,8 +273,8 @@ func (c *AuthController) Googleoauth2callback(ctx *app.Googleoauth2callbackAuthC
  // Set auth header for client retrieval
  authToken := fmt.Sprintf("Bearer %s", jwt)
  - q.Set("token", url.QueryEscape(authToken))
  - u.RawQuery = q.Encode()
  + q.Set("token", authToken)
  + u.RawQuery = encode(q)
  ctx.ResponseData.Header().Set("Authorization", authToken)
  ctx.ResponseWriter.Header().Set("location", u.String())
  