@@ -51,7 +51,7 @@ func GetListLockHandler(ctx *context.Context) {
5151 repository , err := repo_model .GetRepositoryByOwnerAndName (ctx , rv .User , rv .Repo )
5252 if err != nil {
5353 log .Debug ("Could not find repository: %s/%s - %s" , rv .User , rv .Repo , err )
54- ctx .Resp .Header ().Set ("WWW-Authenticate" , " Basic realm=gitea-lfs" )
54+ ctx .Resp .Header ().Set ("WWW-Authenticate" , ` Basic realm=" gitea-lfs"` )
5555 ctx .JSON (http .StatusUnauthorized , api.LFSLockError {
5656 Message : "You must have pull access to list locks" ,
5757 })
@@ -66,7 +66,7 @@ func GetListLockHandler(ctx *context.Context) {
6666
6767 authenticated := authenticate (ctx , repository , rv .Authorization , true , false )
6868 if ! authenticated {
69- ctx .Resp .Header ().Set ("WWW-Authenticate" , " Basic realm=gitea-lfs" )
69+ ctx .Resp .Header ().Set ("WWW-Authenticate" , ` Basic realm=" gitea-lfs"` )
7070 ctx .JSON (http .StatusUnauthorized , api.LFSLockError {
7171 Message : "You must have pull access to list locks" ,
7272 })
@@ -143,7 +143,7 @@ func PostLockHandler(ctx *context.Context) {
143143 repository , err := repo_model .GetRepositoryByOwnerAndName (ctx , userName , repoName )
144144 if err != nil {
145145 log .Error ("Unable to get repository: %s/%s Error: %v" , userName , repoName , err )
146- ctx .Resp .Header ().Set ("WWW-Authenticate" , " Basic realm=gitea-lfs" )
146+ ctx .Resp .Header ().Set ("WWW-Authenticate" , ` Basic realm=" gitea-lfs"` )
147147 ctx .JSON (http .StatusUnauthorized , api.LFSLockError {
148148 Message : "You must have push access to create locks" ,
149149 })
@@ -158,7 +158,7 @@ func PostLockHandler(ctx *context.Context) {
158158
159159 authenticated := authenticate (ctx , repository , authorization , true , true )
160160 if ! authenticated {
161- ctx .Resp .Header ().Set ("WWW-Authenticate" , " Basic realm=gitea-lfs" )
161+ ctx .Resp .Header ().Set ("WWW-Authenticate" , ` Basic realm=" gitea-lfs"` )
162162 ctx .JSON (http .StatusUnauthorized , api.LFSLockError {
163163 Message : "You must have push access to create locks" ,
164164 })
@@ -191,7 +191,7 @@ func PostLockHandler(ctx *context.Context) {
191191 return
192192 }
193193 if git_model .IsErrLFSUnauthorizedAction (err ) {
194- ctx .Resp .Header ().Set ("WWW-Authenticate" , " Basic realm=gitea-lfs" )
194+ ctx .Resp .Header ().Set ("WWW-Authenticate" , ` Basic realm=" gitea-lfs"` )
195195 ctx .JSON (http .StatusUnauthorized , api.LFSLockError {
196196 Message : "You must have push access to create locks : " + err .Error (),
197197 })
@@ -215,7 +215,7 @@ func VerifyLockHandler(ctx *context.Context) {
215215 repository , err := repo_model .GetRepositoryByOwnerAndName (ctx , userName , repoName )
216216 if err != nil {
217217 log .Error ("Unable to get repository: %s/%s Error: %v" , userName , repoName , err )
218- ctx .Resp .Header ().Set ("WWW-Authenticate" , " Basic realm=gitea-lfs" )
218+ ctx .Resp .Header ().Set ("WWW-Authenticate" , ` Basic realm=" gitea-lfs"` )
219219 ctx .JSON (http .StatusUnauthorized , api.LFSLockError {
220220 Message : "You must have push access to verify locks" ,
221221 })
@@ -230,7 +230,7 @@ func VerifyLockHandler(ctx *context.Context) {
230230
231231 authenticated := authenticate (ctx , repository , authorization , true , true )
232232 if ! authenticated {
233- ctx .Resp .Header ().Set ("WWW-Authenticate" , " Basic realm=gitea-lfs" )
233+ ctx .Resp .Header ().Set ("WWW-Authenticate" , ` Basic realm=" gitea-lfs"` )
234234 ctx .JSON (http .StatusUnauthorized , api.LFSLockError {
235235 Message : "You must have push access to verify locks" ,
236236 })
@@ -286,7 +286,7 @@ func UnLockHandler(ctx *context.Context) {
286286 repository , err := repo_model .GetRepositoryByOwnerAndName (ctx , userName , repoName )
287287 if err != nil {
288288 log .Error ("Unable to get repository: %s/%s Error: %v" , userName , repoName , err )
289- ctx .Resp .Header ().Set ("WWW-Authenticate" , " Basic realm=gitea-lfs" )
289+ ctx .Resp .Header ().Set ("WWW-Authenticate" , ` Basic realm=" gitea-lfs"` )
290290 ctx .JSON (http .StatusUnauthorized , api.LFSLockError {
291291 Message : "You must have push access to delete locks" ,
292292 })
@@ -301,7 +301,7 @@ func UnLockHandler(ctx *context.Context) {
301301
302302 authenticated := authenticate (ctx , repository , authorization , true , true )
303303 if ! authenticated {
304- ctx .Resp .Header ().Set ("WWW-Authenticate" , " Basic realm=gitea-lfs" )
304+ ctx .Resp .Header ().Set ("WWW-Authenticate" , ` Basic realm=" gitea-lfs"` )
305305 ctx .JSON (http .StatusUnauthorized , api.LFSLockError {
306306 Message : "You must have push access to delete locks" ,
307307 })
@@ -324,7 +324,7 @@ func UnLockHandler(ctx *context.Context) {
324324 lock , err := git_model .DeleteLFSLockByID (ctx , ctx .PathParamInt64 ("lid" ), repository , ctx .Doer , req .Force )
325325 if err != nil {
326326 if git_model .IsErrLFSUnauthorizedAction (err ) {
327- ctx .Resp .Header ().Set ("WWW-Authenticate" , " Basic realm=gitea-lfs" )
327+ ctx .Resp .Header ().Set ("WWW-Authenticate" , ` Basic realm=" gitea-lfs"` )
328328 ctx .JSON (http .StatusUnauthorized , api.LFSLockError {
329329 Message : "You must have push access to delete locks : " + err .Error (),
330330 })
0 commit comments