Removes the CSRF cookie in favor of [`CrossOriginProtection`](https://pkg.go.dev/net/http#CrossOriginProtection) which relies purely on HTTP headers. Fixes: https://github.com/go-gitea/gitea/issues/11188 Fixes: https://github.com/go-gitea/gitea/issues/30333 Helps: https://github.com/go-gitea/gitea/issues/35107 TODOs: - [x] Fix tests - [ ] Ideally add tests to validates the protection --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
37 lines
1.5 KiB
Handlebars
37 lines
1.5 KiB
Handlebars
{{if and (gt $.Issue.PullRequest.CommitsBehind 0) (not $.Issue.IsClosed) (not $.Issue.PullRequest.IsChecking) (not $.IsPullFilesConflicted) (not $.IsPullRequestBroken)}}
|
|
<div class="divider"></div>
|
|
<div class="item item-section">
|
|
<div class="item-section-left flex-text-inline">
|
|
{{svg "octicon-alert"}}
|
|
{{ctx.Locale.Tr "repo.pulls.outdated_with_base_branch"}}
|
|
</div>
|
|
<div class="item-section-right">
|
|
{{if and $.UpdateAllowed $.UpdateByRebaseAllowed}}
|
|
<div class="tw-inline-block">
|
|
<div id="update-pr-branch-with-base" class="ui buttons">
|
|
<button class="ui button" data-do="{{$.Issue.Link}}/update" data-redirect="{{$.Issue.Link}}">
|
|
<span class="button-text">
|
|
{{ctx.Locale.Tr "repo.pulls.update_branch"}}
|
|
</span>
|
|
</button>
|
|
<div class="ui dropdown icon button">
|
|
{{svg "octicon-triangle-down"}}
|
|
<div class="menu">
|
|
<a class="item active selected" data-do="{{$.Issue.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a>
|
|
<a class="item" data-do="{{$.Issue.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{if and $.UpdateAllowed (not $.UpdateByRebaseAllowed)}}
|
|
<form action="{{$.Issue.Link}}/update" method="post" class="ui update-branch-form">
|
|
<button class="ui compact button">
|
|
<span class="ui text">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</span>
|
|
</button>
|
|
</form>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|