Skip to content

Commit 4009abd

Browse files
committed
as per review
Signed-off-by: Andrew Thornton <[email protected]>
1 parent c519b12 commit 4009abd

File tree

5 files changed

+5
-8
lines changed

5 files changed

+5
-8
lines changed

cmd/web.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ func runHTTPRedirector() {
6767
if len(r.URL.RawQuery) > 0 {
6868
target += "?" + r.URL.RawQuery
6969
}
70-
// FIXME: Why aren't we adding the Fragment?
7170
http.Redirect(w, r, target, http.StatusTemporaryRedirect)
7271
})
7372

modules/context/context.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,14 @@ func RedirectToUser(ctx *Context, userName string, redirectUserID int64) {
129129
}
130130

131131
redirectPath := strings.Replace(
132-
ctx.Req.URL.Path,
133-
userName,
134-
user.Name,
132+
ctx.Req.URL.EscapedPath(),
133+
url.PathEscape(userName),
134+
url.PathEscape(user.Name),
135135
1,
136136
)
137137
if ctx.Req.URL.RawQuery != "" {
138138
redirectPath += "?" + ctx.Req.URL.RawQuery
139139
}
140-
// FIXME: Why not Fragment
141140
ctx.Redirect(path.Join(setting.AppSubURL, redirectPath))
142141
}
143142

modules/context/repo.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ func RedirectToRepo(ctx *Context, redirectRepoID int64) {
328328
if ctx.Req.URL.RawQuery != "" {
329329
redirectPath += "?" + ctx.Req.URL.RawQuery
330330
}
331-
// FIXME: why not Fragment
332331
ctx.Redirect(path.Join(setting.AppSubURL, redirectPath))
333332
}
334333

routers/web/repo/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ func UpdatePullRequest(ctx *context.Context) {
744744
// ToDo: add check if maintainers are allowed to change branch ... (need migration & co)
745745
if (!allowedUpdateByMerge && !rebase) || (rebase && !allowedUpdateByRebase) {
746746
ctx.Flash.Error(ctx.Tr("repo.pulls.update_not_allowed"))
747-
ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + url.PathEscape(fmt.Sprint(issue.Index)))
747+
ctx.Redirect(issue.Link())
748748
return
749749
}
750750

templates/repo/branch/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</td>
2626
<td class="right aligned overflow-visible">
2727
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
28-
<div class="ui basic jump button icon poping up show-create-branch-modal" data-content="{{$.i18n.Tr "repo.branch.new_branch_from" ($.DefaultBranch)}}" data-variation="tiny inverted" data-branch-from="{{$.DefaultBranch}}" data-modal="#create-branch-modal" data-position="top right">
28+
<div class="ui basic jump button icon poping up show-create-branch-modal" data-content="{{$.i18n.Tr "repo.branch.new_branch_from" ($.DefaultBranch)}}" data-variation="tiny inverted" data-branch-from="{{$.DefaultBranch}}" data-branch-from-urlcomponent="{{PathEscapeSegments $.DefaultBranch}}" data-modal="#create-branch-modal" data-position="top right">
2929
{{svg "octicon-git-branch"}}
3030
</div>
3131
{{end}}

0 commit comments

Comments
 (0)