Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10648)

Issue 9671043: code review 9671043: google-api-go-client: avoid reencoding parameters in th... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 11 months ago by francesc
Modified:
10 years, 11 months ago
Reviewers:
bradfitz
CC:
bradfitz, adg, golang-dev
Visibility:
Public.

Description

google-api-go-client: avoid reencoding parameters in the URL path Some APIs, such as cloud storage, need to use values that are being now removed. '%2F' is replaced by '/' url.Parse, which is called by http.NewRequest.

Patch Set 1 #

Patch Set 2 : diff -r c96beb0b4acd https://code.google.com/p/google-api-go-client #

Patch Set 3 : diff -r c96beb0b4acd https://code.google.com/p/google-api-go-client #

Patch Set 4 : diff -r c96beb0b4acd https://code.google.com/p/google-api-go-client #

Patch Set 5 : diff -r c96beb0b4acd https://code.google.com/p/google-api-go-client #

Patch Set 6 : diff -r c96beb0b4acd https://code.google.com/p/google-api-go-client #

Total comments: 6

Patch Set 7 : diff -r c96beb0b4acd https://code.google.com/p/google-api-go-client #

Total comments: 2

Patch Set 8 : diff -r c96beb0b4acd https://code.google.com/p/google-api-go-client #

Total comments: 5

Patch Set 9 : diff -r c96beb0b4acd https://code.google.com/p/google-api-go-client #

Patch Set 10 : diff -r c96beb0b4acd https://code.google.com/p/google-api-go-client #

Patch Set 11 : diff -r c96beb0b4acd https://code.google.com/p/google-api-go-client #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -6 lines) Patch
M google-api-go-generator/gen.go View 1 2 3 4 5 6 7 8 4 chunks +10 lines, -6 lines 0 comments Download

Messages

Total messages: 18
francesc
Hello bradfitz@golang.org, adg@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/google-api-go-client
10 years, 11 months ago (2013-05-22 19:58:37 UTC) #1
bradfitz
does this break other APIs, though? I'm afraid you're only testing cloud storage. On Wed, ...
10 years, 11 months ago (2013-05-22 20:08:07 UTC) #2
francesc
I'm also testing other APIs (taskqueue, for instance) but I don't know if there's a ...
10 years, 11 months ago (2013-05-22 20:31:52 UTC) #3
francesc
I found url.QueryEscape that does exactly what I wanted. PTAL
10 years, 11 months ago (2013-05-22 23:22:54 UTC) #4
adg
http://golang.org/pkg/net/url/#QueryEscape ?
10 years, 11 months ago (2013-05-22 23:24:45 UTC) #5
adg
I'd like to see all the changes to generated code in this CL, too. Not ...
10 years, 11 months ago (2013-05-22 23:28:55 UTC) #6
bradfitz
On Wed, May 22, 2013 at 4:28 PM, <adg@golang.org> wrote: > I'd like to see ...
10 years, 11 months ago (2013-05-22 23:35:31 UTC) #7
francesc
All the changes are here: https://codereview.appspot.com/9672043/ https://codereview.appspot.com/9671043/diff/12001/google-api-go-generator/gen.go File google-api-go-generator/gen.go (right): https://codereview.appspot.com/9671043/diff/12001/google-api-go-generator/gen.go#newcode1150 google-api-go-generator/gen.go:1150: // E.g. Cloud ...
10 years, 11 months ago (2013-05-22 23:39:13 UTC) #8
bradfitz
is this really the right use of req.URL.Opaque? I remember knowing this once, but it ...
10 years, 11 months ago (2013-05-22 23:45:43 UTC) #9
adg
On 23 May 2013 09:45, Brad Fitzpatrick <bradfitz@golang.org> wrote: > is this really the right ...
10 years, 11 months ago (2013-05-22 23:52:00 UTC) #10
adg
https://codereview.appspot.com/9671043/diff/17001/google-api-go-generator/gen.go File google-api-go-generator/gen.go (right): https://codereview.appspot.com/9671043/diff/17001/google-api-go-generator/gen.go#newcode1155 google-api-go-generator/gen.go:1155: pn("req.URL.Opaque = req.URL.Path\n") I think this should be pn(`req.URL.Opaque ...
10 years, 11 months ago (2013-05-23 00:27:58 UTC) #11
francesc
I tested and it works with your solution too. Opaque fields are opaque ... https://codereview.appspot.com/9671043/diff/17001/google-api-go-generator/gen.go ...
10 years, 11 months ago (2013-05-23 00:41:35 UTC) #12
adg
I'm a bit worried about your tests if it worked before. The way you had ...
10 years, 11 months ago (2013-05-23 00:45:36 UTC) #13
francesc
https://codereview.appspot.com/9671043/diff/19002/google-api-go-generator/gen.go File google-api-go-generator/gen.go (right): https://codereview.appspot.com/9671043/diff/19002/google-api-go-generator/gen.go#newcode1152 google-api-go-generator/gen.go:1152: pn("req.URL.Path = strings.Replace(req.URL.Path, \"{%s}\", %s, 1)\n", arg.apiname, arg.cleanExpr("c.")) On ...
10 years, 11 months ago (2013-05-23 00:53:23 UTC) #14
adg
This looks ok to me now, but wait for brad. https://codereview.appspot.com/9671043/diff/19002/google-api-go-generator/gen.go File google-api-go-generator/gen.go (right): https://codereview.appspot.com/9671043/diff/19002/google-api-go-generator/gen.go#newcode1152 ...
10 years, 11 months ago (2013-05-23 02:31:38 UTC) #15
francesc
Gentle ping for Brad On Wed, May 22, 2013 at 7:31 PM, <adg@golang.org> wrote: > ...
10 years, 11 months ago (2013-05-23 17:35:14 UTC) #16
bradfitz
LGTM I think. Be sure to ask people to test it go golang-nuts after you ...
10 years, 11 months ago (2013-05-23 21:15:47 UTC) #17
francesc
10 years, 11 months ago (2013-05-23 21:18:29 UTC) #18
*** Submitted as
https://code.google.com/p/google-api-go-client/source/detail?r=49979a5f1445 ***

google-api-go-client: avoid reencoding parameters in the URL path

Some APIs, such as cloud storage, need to use values that are being
now removed.
'%2F' is replaced by '/' url.Parse, which is called by http.NewRequest.

R=bradfitz, adg
CC=golang-dev
https://codereview.appspot.com/9671043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b