Merge changes Icdb9af95,I7d1addf4
* changes: Return correct error code from accounts/self/detail in test server Fix hit target size for change file path
This commit is contained in:
@@ -61,13 +61,11 @@ limitations under the License.
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding-left: .35em;
|
padding-left: .35em;
|
||||||
|
text-decoration: none;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.path a {
|
.path:hover :first-child {
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
.path a:hover {
|
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
.oldPath {
|
.oldPath {
|
||||||
@@ -136,16 +134,15 @@ limitations under the License.
|
|||||||
<div class$="[[_computeClass('status', file.__path)]]">
|
<div class$="[[_computeClass('status', file.__path)]]">
|
||||||
[[_computeFileStatus(file.status)]]
|
[[_computeFileStatus(file.status)]]
|
||||||
</div>
|
</div>
|
||||||
<div class="path">
|
<a class="path" href$="[[_computeDiffURL(changeNum, patchNum, file.__path)]]">
|
||||||
<a href$="[[_computeDiffURL(changeNum, patchNum, file.__path)]]"
|
<div title$="[[_computeFileDisplayName(file.__path)]]">
|
||||||
title="[[_computeFileDisplayName(file.__path)]]">
|
|
||||||
[[_computeFileDisplayName(file.__path)]]
|
[[_computeFileDisplayName(file.__path)]]
|
||||||
</a>
|
</div>
|
||||||
<div class="oldPath" hidden$="[[!file.old_path]]" hidden
|
<div class="oldPath" hidden$="[[!file.old_path]]" hidden
|
||||||
title="[[file.old_path]]">
|
title$="[[file.old_path]]">
|
||||||
[[file.old_path]]
|
[[file.old_path]]
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</a>
|
||||||
<div class="comments">
|
<div class="comments">
|
||||||
<span class="drafts">[[_computeDraftsString(drafts, patchNum, file.__path)]]</span>
|
<span class="drafts">[[_computeDraftsString(drafts, patchNum, file.__path)]]</span>
|
||||||
[[_computeCommentsString(comments, patchNum, file.__path)]]
|
[[_computeCommentsString(comments, patchNum, file.__path)]]
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import (
|
|||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"errors"
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
@@ -33,7 +32,6 @@ var (
|
|||||||
restHost = flag.String("host", "gerrit-review.googlesource.com", "Host to proxy requests to")
|
restHost = flag.String("host", "gerrit-review.googlesource.com", "Host to proxy requests to")
|
||||||
port = flag.String("port", ":8081", "Port to serve HTTP requests on")
|
port = flag.String("port", ":8081", "Port to serve HTTP requests on")
|
||||||
prod = flag.Bool("prod", false, "Serve production assets")
|
prod = flag.Bool("prod", false, "Serve production assets")
|
||||||
loggedIn = flag.Bool("logged_in", false, "Return user info as if the user is logged in")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -79,27 +77,9 @@ func handleRESTProxy(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func handleAccountDetail(w http.ResponseWriter, r *http.Request) {
|
func handleAccountDetail(w http.ResponseWriter, r *http.Request) {
|
||||||
if !*loggedIn {
|
http.Error(w, http.StatusText(http.StatusForbidden), http.StatusForbidden)
|
||||||
http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Fprint(w, accountInfo)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const accountInfo = `)]}'
|
|
||||||
{
|
|
||||||
"registered_on": "2015-08-31 21:24:17.614000000",
|
|
||||||
"_account_id": 1021482,
|
|
||||||
"name": "Andrew Bonventre",
|
|
||||||
"email": "andybons@chromium.org",
|
|
||||||
"avatars": [
|
|
||||||
{
|
|
||||||
"url": "https://lh4.googleusercontent.com/-1EovlES413I/AAAAAAAAAAI/AAAAAAAAAAA/GQ5-31ULE1Q/s26-p/photo.jpg",
|
|
||||||
"height": 26
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}`
|
|
||||||
|
|
||||||
type gzipResponseWriter struct {
|
type gzipResponseWriter struct {
|
||||||
io.WriteCloser
|
io.WriteCloser
|
||||||
http.ResponseWriter
|
http.ResponseWriter
|
||||||
|
|||||||
Reference in New Issue
Block a user