Skip to content
Snippets Groups Projects
Commit 909508cb authored by Bruce Flynn's avatar Bruce Flynn
Browse files

fix bad pat

parent 19ea4701
Branches main
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ COPY . .
RUN dep ensure && ./build.sh
FROM debian:buster-slim
COPY --from=build /go/bin/chart-server .
ENTRYPOINT ["./chart-server"]
......
......@@ -38,7 +38,7 @@ func handleUpload(w http.ResponseWriter, r *http.Request) {
http.Error(w, "InternalServerError", http.StatusInternalServerError)
return
}
// got a stat result, file must exist
// got a stat result, file must exist already and we should not overwrite
if st != nil {
http.Error(w, "File exists", http.StatusForbidden)
return
......@@ -173,7 +173,7 @@ Options can also be specified as environment variables $CHART_SVR_<name>
r.HandleFunc("/status", handleStatus).Methods("GET")
// Limit to only index.yaml and chart (.tgz) files
r.HandleFunc(`/{filename:(?:index.yaml|.*-.*.tgz)}`, handleGetFile).Methods("GET")
r.HandleFunc(`/{chart:.*-.*\.tgz}`, handleUpload).Methods("PUT")
r.HandleFunc(`/{chart:.*-.*.tgz}`, handleUpload).Methods("PUT")
r.HandleFunc("/", handleGetHome)
h := handlers.CombinedLoggingHandler(os.Stdout, handlers.CORS()(r))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment