Compare commits
2 Commits
direct-fix
...
main
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
f878e4895e | ||
| 20e1109602 |
@@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: autogits
|
||||
Version: 0
|
||||
Version: 1
|
||||
Release: 0
|
||||
Summary: GitWorkflow utilities
|
||||
License: GPL-2.0-or-later
|
||||
@@ -41,6 +41,7 @@ Command-line tool to import devel projects from obs to git
|
||||
|
||||
%package doc
|
||||
Summary: Common documentation files
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n autogits-doc
|
||||
Common documentation files
|
||||
@@ -56,10 +57,11 @@ with a topic
|
||||
|
||||
|
||||
%package gitea-status-proxy
|
||||
Summary: gitea-status-proxy
|
||||
Summary: Proxy for setting commit status in Gitea
|
||||
|
||||
%description gitea-status-proxy
|
||||
|
||||
Setting commit status requires code write access token. This proxy
|
||||
is middleware that delegates status setting without access to other APIs
|
||||
|
||||
%package group-review
|
||||
Summary: Reviews of groups defined in ProjectGit
|
||||
@@ -213,6 +215,18 @@ install -D -m0755 utils/hujson/hujson
|
||||
%postun obs-status-service
|
||||
%service_del_postun obs-status-service.service
|
||||
|
||||
%pre workflow-pr
|
||||
%service_add_pre workflow-direct@.service
|
||||
|
||||
%post workflow-pr
|
||||
%service_add_post workflow-direct@.service
|
||||
|
||||
%preun workflow-pr
|
||||
%service_del_preun workflow-direct@.service
|
||||
|
||||
%postun workflow-pr
|
||||
%service_del_postun workflow-direct@.service
|
||||
|
||||
%files devel-importer
|
||||
%license COPYING
|
||||
%doc devel-importer/README.md
|
||||
|
||||
@@ -275,7 +275,7 @@ func main() {
|
||||
res.Write([]byte("404 page not found\n"))
|
||||
})
|
||||
http.HandleFunc("GET /status/{Project}", func(res http.ResponseWriter, req *http.Request) {
|
||||
mime := ParseMimeHeader(req)
|
||||
mime := ParseMimeHeaderAndQuery(req)
|
||||
obsPrj := req.PathValue("Project")
|
||||
common.LogInfo(" GET /status/"+obsPrj, "["+mime.MimeType()+"]")
|
||||
|
||||
@@ -296,7 +296,7 @@ func main() {
|
||||
}
|
||||
})
|
||||
http.HandleFunc("GET /status/{Project}/{Package}", func(res http.ResponseWriter, req *http.Request) {
|
||||
mime := ParseMimeHeader(req)
|
||||
mime := ParseMimeHeaderAndQuery(req)
|
||||
obsPrj := req.PathValue("Project")
|
||||
obsPkg := req.PathValue("Package")
|
||||
common.LogInfo(" GET /status/"+obsPrj+"/"+obsPkg, "["+mime.MimeType()+"]")
|
||||
@@ -326,7 +326,7 @@ func main() {
|
||||
|
||||
})
|
||||
http.HandleFunc("GET /status/{Project}/{Package}/{Repository}", func(res http.ResponseWriter, req *http.Request) {
|
||||
mime := ParseMimeHeader(req)
|
||||
mime := ParseMimeHeaderAndQuery(req)
|
||||
obsPrj := req.PathValue("Project")
|
||||
obsPkg := req.PathValue("Package")
|
||||
repo := req.PathValue("Repository")
|
||||
@@ -355,7 +355,7 @@ func main() {
|
||||
}
|
||||
})
|
||||
http.HandleFunc("GET /status/{Project}/{Package}/{Repository}/{Arch}", func(res http.ResponseWriter, req *http.Request) {
|
||||
mime := ParseMimeHeader(req)
|
||||
mime := ParseMimeHeaderAndQuery(req)
|
||||
prj := req.PathValue("Project")
|
||||
pkg := req.PathValue("Package")
|
||||
repo := req.PathValue("Repository")
|
||||
|
||||
@@ -21,7 +21,16 @@ var AcceptedStatusMimes []string = []string{
|
||||
XmlMime,
|
||||
}
|
||||
|
||||
func ParseMimeHeader(req *http.Request) *MimeHeader {
|
||||
func ParseMimeHeaderAndQuery(req *http.Request) *MimeHeader {
|
||||
format := req.URL.Query().Get("format")
|
||||
switch format {
|
||||
case "svg":
|
||||
return &MimeHeader{MimeHeader: SvgMime}
|
||||
case "json":
|
||||
return &MimeHeader{MimeHeader: JsonMime}
|
||||
case "xml":
|
||||
return &MimeHeader{MimeHeader: XmlMime}
|
||||
}
|
||||
proposedMimes := req.Header.Values("Accept")
|
||||
mime := MimeHeader{MimeHeader: SvgMime}
|
||||
if len(proposedMimes) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user