Skip to content

Commit

Permalink
MB-30075: Handle the index creation case with URL parameters
Browse files Browse the repository at this point in the history
Handle the case where the index/alias is to be created without
a request body, and all that is necessary is passed in as form
parameters.

Change-Id: Ib9123242e10d4e5c5781f3e23f234441c5edc046
Reviewed-on: http://review.couchbase.org/95524
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Abhinav Dangeti <abhinav@couchbase.com>
  • Loading branch information
abhinavdangeti committed Jun 13, 2018
1 parent 215374f commit 4305333
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rest_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ func findCouchbaseSourceNames(req *http.Request, indexName string,
}
}

if indexDef.Type == "" {
// if indexType wasn't found in the request body, attempt reading it
// from the form entries.
indexDef.Type = req.FormValue("indexType")
}

if indexDef.Type == "fulltext-index" {
sourceType, sourceName := rest.ExtractSourceTypeName(req, &indexDef, indexName)
if sourceType == "couchbase" {
Expand Down

0 comments on commit 4305333

Please sign in to comment.