Merge branch 'master' into v0.12

* master:
  Update docs & translations
  build.sh prerelease should rebuild author credits in about dialog
  Use dialer in relay checks (fixes #2732)
  Handle null case for invalid ng-model value (fixes #2392)
  Return status code 307 instead of 302 when redirecting from HTTP to HTTPS
  Benchmark for single database update
  Add a CORS handler to deal with preflight OPTIONS requests
  Add letiemble
  Update docs and translations
  Correct order of pkill(1) arguments in debian script (fixes #2728)
This commit is contained in:
Jakob Borg
2016-01-31 10:39:10 +01:00
35 changed files with 411 additions and 95 deletions
+18
View File
@@ -172,6 +172,24 @@ func TestGetJSON(t *testing.T) {
}
}
func TestOptions(t *testing.T) {
p := startInstance(t, 2)
defer checkedStop(t, p)
req, err := http.NewRequest("OPTIONS", "http://127.0.0.1:8082/rest/system/error/clear", nil)
if err != nil {
t.Fatal(err)
}
res, err := http.DefaultClient.Do(req)
if err != nil {
t.Fatal(err)
}
res.Body.Close()
if res.StatusCode != 204 {
t.Fatalf("Status %d != 204 for OPTIONS", res.StatusCode)
}
}
func TestPOSTWithoutCSRF(t *testing.T) {
p := startInstance(t, 2)
defer checkedStop(t, p)