Skip to content

Commit 9f45d5d

Browse files
committed
test for cutting off location of owner check
1 parent 9ce259e commit 9f45d5d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/update-server.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
branches:
1111
- "main"
1212
- "dev"
13+
- "test"
1314
tags:
1415
- 'v*'
1516

@@ -53,7 +54,7 @@ jobs:
5354
uses: "WyriHaximus/github-action-get-previous-tag@v1"
5455
id: get-latest-tag
5556
with:
56-
fallback: latest
57+
fallback: test # latest
5758

5859
# - name: Build
5960
# run: cd packages/backend/;go mod tidy;export CGO_ENABLED=0;make build-backend;ls

pkg/http/data.go

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ type handleFunc func(w http.ResponseWriter, r *http.Request, d *common.Data) (in
1515

1616
func handle(fn handleFunc, prefix string, server *settings.Server) http.Handler {
1717
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
18+
if prefix == "/api/paste" || (prefix == "/api/resources" && r.Method == http.MethodPatch) {
19+
klog.Warningf("Is src and dst yours? We'll check it for %s %s", r.Method, r.URL.Path)
20+
} else if prefix == "/api/resources" || prefix == "/api/raw" || prefix == "/api/preview" {
21+
klog.Warningf("Is src yours? We'll check it for %s %s", r.Method, r.URL.Path)
22+
}
23+
1824
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
1925

2026
status, err := fn(w, r, &common.Data{

0 commit comments

Comments
 (0)