api: BucketNotification should disallow duplicate notification. (#2539)

Added checks to look for duplicated notification configs.

Fixes #2472
This commit is contained in:
Harshavardhana
2016-08-23 18:42:30 -07:00
committed by GitHub
parent c39d3db7a0
commit ec4260d260
6 changed files with 113 additions and 43 deletions

View File

@@ -1840,10 +1840,6 @@ var DB = map[string]struct {
ContentType: "image/vnd.ms-modi",
Compressible: false,
},
"mdp": {
ContentType: "application/dash+xml",
Compressible: false,
},
"me": {
ContentType: "text/troff",
Compressible: false,
@@ -2008,6 +2004,10 @@ var DB = map[string]struct {
ContentType: "application/vnd.mophun.certificate",
Compressible: false,
},
"mpd": {
ContentType: "application/dash+xml",
Compressible: false,
},
"mpe": {
ContentType: "video/mpeg",
Compressible: false,
@@ -2824,6 +2824,10 @@ var DB = map[string]struct {
ContentType: "application/relax-ng-compact-syntax",
Compressible: false,
},
"rng": {
ContentType: "application/xml",
Compressible: false,
},
"roa": {
ContentType: "application/rpki-roa",
Compressible: false,
@@ -3088,6 +3092,14 @@ var DB = map[string]struct {
ContentType: "application/vnd.openxmlformats-officedocument.presentationml.slide",
Compressible: false,
},
"slim": {
ContentType: "text/slim",
Compressible: false,
},
"slm": {
ContentType: "text/slim",
Compressible: false,
},
"slt": {
ContentType: "application/vnd.epson.salt",
Compressible: false,

View File

@@ -1,5 +1,5 @@
/*
* mime-db: Mime Database, (C) 2015 Minio, Inc.
* mime-db: Mime Database, (C) 2015, 2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,24 +14,18 @@
* limitations under the License.
*/
package mimedb_test
package mimedb
import (
"testing"
import "testing"
"github.com/minio/minio/pkg/mimedb"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }
type MySuite struct{}
var _ = Suite(&MySuite{})
func (s *MySuite) TestLookup(c *C) {
// Test MustLookup.
contentType := mimedb.DB["exe"].ContentType
c.Assert(contentType, Not(Equals), "")
func TestMimeLookup(t *testing.T) {
// Test mimeLookup.
contentType := DB["txt"].ContentType
if contentType != "text/plain" {
t.Fatalf("Invalid content type are found expected \"application/x-msdownload\", got %s", contentType)
}
compressible := DB["txt"].Compressible
if compressible != false {
t.Fatalf("Invalid content type are found expected \"false\", got %t", compressible)
}
}