Skip to content

Commit c672c67

Browse files
committed
Merge pull request #17 from yuann/master
Fix wrong redirects
2 parents 8dd4f97 + e8ed239 commit c672c67

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/main/scala/gitbucket/gist/controller/GistController.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ trait GistControllerBase extends ControllerBase {
157157
refUpdate.update()
158158
}
159159

160-
redirect(s"${context.path}/gist/${loginAccount.userName}/${repoName}")
160+
redirect(s"/gist/${loginAccount.userName}/${repoName}")
161161
})
162162

163163
get("/gist/:userName/:repoName/delete")(editorOnly {
@@ -170,7 +170,7 @@ trait GistControllerBase extends ControllerBase {
170170
val gitdir = new File(GistRepoDir, userName + "/" + repoName)
171171
org.apache.commons.io.FileUtils.deleteDirectory(gitdir)
172172

173-
redirect(s"${context.path}/gist/${userName}")
173+
redirect(s"/gist/${userName}")
174174
}
175175
})
176176

@@ -182,7 +182,7 @@ trait GistControllerBase extends ControllerBase {
182182
updateGistAccessibility(userName, repoName, true)
183183
}
184184

185-
redirect(s"${context.path}/gist/${userName}/${repoName}")
185+
redirect(s"/gist/${userName}/${repoName}")
186186
})
187187

188188
get("/gist/:userName/:repoName/public")(editorOnly {
@@ -193,7 +193,7 @@ trait GistControllerBase extends ControllerBase {
193193
updateGistAccessibility(userName, repoName, false)
194194
}
195195

196-
redirect(s"${context.path}/gist/${userName}/${repoName}")
196+
redirect(s"/gist/${userName}/${repoName}")
197197
})
198198

199199
get("/gist/:userName/:repoName/revisions"){
@@ -304,7 +304,7 @@ trait GistControllerBase extends ControllerBase {
304304
val loginAccount = context.loginAccount.get
305305

306306
if(getGist(loginAccount.userName, repoName).isDefined){
307-
redirect(s"${context.path}/gist/${userName}/${repoName}")
307+
redirect(s"/gist/${userName}/${repoName}")
308308
} else {
309309
getGist(userName, repoName).map { gist =>
310310
// Insert to the database at first
@@ -320,7 +320,7 @@ trait GistControllerBase extends ControllerBase {
320320
new File(GistRepoDir, loginAccount.userName + "/" + repoName)
321321
)
322322

323-
redirect(s"${context.path}/gist/${loginAccount.userName}/${repoName}")
323+
redirect(s"/gist/${loginAccount.userName}/${repoName}")
324324

325325
} getOrElse NotFound
326326
}
@@ -375,7 +375,7 @@ trait GistControllerBase extends ControllerBase {
375375

376376
getGist(userName, repoName).map { gist =>
377377
registerGistComment(userName, repoName, form.content, loginAccount.userName)
378-
redirect(s"${context.path}/gist/${userName}/${repoName}")
378+
redirect(s"/gist/${userName}/${repoName}")
379379
} getOrElse NotFound
380380
})
381381

0 commit comments

Comments
 (0)