Deploy blocks until old dies, fix cors via rproxy3, and who accepts acceptable name
parent
599d52cf8d
commit
461592ec40
|
|
@ -3,8 +3,10 @@
|
|||
function main() {
|
||||
cd "$(dirname "$BASH_SOURCE")"
|
||||
set -e
|
||||
go test ./...
|
||||
GOOS=linux GOARCH=arm GOARM=5 CGO_ENABLED=0 go build -o $(basename "$PWD") -a -installsuffix cgo
|
||||
scp ./dndex zach@192.168.1.123:./dndex/dndex.new
|
||||
ssh zach@192.168.1.123 bash -c 'true; while [ -e ./dndex/dndex.new ]; do printf "."; sleep 3; done; echo'
|
||||
}
|
||||
|
||||
if [ "$0" == "$BASH_SOURCE" ]; then
|
||||
|
|
|
|||
|
|
@ -49,7 +49,13 @@ func jsonHandler(g storage.Graph) http.Handler {
|
|||
}
|
||||
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
/*
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, OPTIONS, TRACE")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
|
||||
*/
|
||||
|
||||
if gziphttp.Can(r) {
|
||||
gz := gziphttp.New(w)
|
||||
defer gz.Close()
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ func whoPut(namespace string, g storage.Graph, w http.ResponseWriter, r *http.Re
|
|||
if err := json.Unmarshal(body, &operation); err != nil {
|
||||
return err
|
||||
}
|
||||
if operation.Name != "" {
|
||||
http.Error(w, `{"error":"cannot specify name in request body"}`, http.StatusBadRequest)
|
||||
if operation.Name != "" && operation.Name != id {
|
||||
http.Error(w, `{"error":"names differ between URL and request body"}`, http.StatusBadRequest)
|
||||
return nil
|
||||
}
|
||||
if operation.Modified != 0 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue