| a | b | |
|---|
| 0 | + | |
|---|
| 0 | + | This is my testing setup: I created a new database (test) that doesn't use any VHost rules. |
|---|
| 0 | + | |
|---|
| 0 | + | Inside it I created a design document that only has rewrites field. There are three different rewrite configurations I used and 4 commands that I ran. For each command run I provide exact command I used, the output, my comment |
|---|
| 0 | + | of the output and relevant log from couch.log. |
|---|
| 0 | + | |
|---|
| 0 | + | I always sent the same document contained in file "example" - namely: |
|---|
| 0 | + | { |
|---|
| 0 | + | "type": "comment" |
|---|
| 0 | + | } |
|---|
| 0 | + | |
|---|
| 0 | + | Below are the test results: |
|---|
| 0 | + | ---------------------------------------------------------------------------------------------------- |
|---|
| 0 | + | ## Test 1: |
|---|
| 0 | + | # rewrites config: |
|---|
| 0 | + | [ |
|---|
| 0 | + | { |
|---|
| 0 | + | "to": "../..", |
|---|
| 0 | + | "from": ":db" |
|---|
| 0 | + | } |
|---|
| 0 | + | ] |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | # Executed command 1.1: |
|---|
| 0 | + | $ curl -d @example -H "Content-type:application/json" -e http://localhost:5984/test http://localhost:5984/test/ |
|---|
| 0 | + | {"ok":true,"id":"ce8b504d63666c9257cc07537c00aa70","rev":"1-505a221d0aef5d664f29d6afdae01293"} |
|---|
| 0 | + | |
|---|
| 0 | + | # Comment: expected result - everything is fine. |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | # Executed command 1.2: |
|---|
| 0 | + | $ curl -X PUT -d @example -H "Content-type:application/json" http://localhost:5984/test/_design/test/_rewrite/test/randomid324324 |
|---|
| 0 | + | {"error":"not_found","reason":"missing"} |
|---|
| 0 | + | |
|---|
| 0 | + | # Comment: result expected since there is no ID parameter passed through - due to the rewrite rule |
|---|
| 0 | + | |
|---|
| 0 | + | #LOG: |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:42:17 GMT] [debug] [<0.8844.3>] 'PUT' /test/_design/test/_rewrite/test/randomid324324 {1,1} |
|---|
| 0 | + | Headers: [{'Accept',"*/*"}, |
|---|
| 0 | + | {'Content-Length',"23"}, |
|---|
| 0 | + | {'Content-Type',"application/json"}, |
|---|
| 0 | + | {'Host',"localhost:5984"}, |
|---|
| 0 | + | {'User-Agent',"curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:42:17 GMT] [debug] [<0.8844.3>] OAuth Params: [] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:42:17 GMT] [debug] [<0.8844.3>] Minor error in HTTP request: not_found |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:42:17 GMT] [debug] [<0.8844.3>] Stacktrace: [{couch_httpd_rewrite,handle_rewrite_req,3}, |
|---|
| 0 | + | {couch_httpd_db,do_db_req,2}, |
|---|
| 0 | + | {couch_httpd,handle_request_int,5}, |
|---|
| 0 | + | {mochiweb_http,headers,5}, |
|---|
| 0 | + | {proc_lib,init_p_do_apply,3}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:42:17 GMT] [info] [<0.8844.3>] 127.0.0.1 - - 'PUT' /test/_design/test/_rewrite/test/randomid324324 404 |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:42:17 GMT] [debug] [<0.8844.3>] httpd 404 error response: |
|---|
| 0 | + | {"error":"not_found","reason":"missing"} |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | |
|---|
| 0 | + | # Executed command 1.3: |
|---|
| 0 | + | $curl -d @example -H "Content-type:application/json" -e http://localhost:5984/test http://localhost:5984/test/_design/test/_rewrite/test/ |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | # Comment: Rewrite is wrong - also peculiar it won't take application/json content type. |
|---|
| 0 | + | |
|---|
| 0 | + | # LOG: |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:51:55 GMT] [debug] [<0.9453.3>] 'POST' /test/_design/test/_rewrite/test/ {1,1} |
|---|
| 0 | + | Headers: [{'Accept',"*/*"}, |
|---|
| 0 | + | {'Content-Length',"23"}, |
|---|
| 0 | + | {'Content-Type',"application/json"}, |
|---|
| 0 | + | {'Host',"localhost:5984"}, |
|---|
| 0 | + | {'Referer',"http://localhost:5984/test"}, |
|---|
| 0 | + | {'User-Agent',"curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:51:55 GMT] [debug] [<0.9453.3>] OAuth Params: [] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:51:55 GMT] [debug] [<0.9453.3>] rewrite to "/test/_design/..?db=test" |
|---|
| 0 | + | |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:51:55 GMT] [debug] [<0.9453.3>] 'POST' /test/_design/..?db=test {1,1} |
|---|
| 0 | + | Headers: [{'Accept',"*/*"}, |
|---|
| 0 | + | {'Content-Length',"23"}, |
|---|
| 0 | + | {'Content-Type',"application/json"}, |
|---|
| 0 | + | {'Host',"localhost:5984"}, |
|---|
| 0 | + | {'Referer',"http://localhost:5984/test"}, |
|---|
| 0 | + | {'User-Agent',"curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:51:55 GMT] [debug] [<0.9453.3>] OAuth Params: [{"db","test"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:51:55 GMT] [debug] [<0.9453.3>] Minor error in HTTP request: {bad_ctype, |
|---|
| 0 | + | |
|---|
| 0 | + | "Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:51:55 GMT] [debug] [<0.9453.3>] Stacktrace: [{couch_httpd,validate_ctype,2}, |
|---|
| 0 | + | {couch_httpd_db,db_doc_req,3}, |
|---|
| 0 | + | {couch_httpd_db,do_db_req,2}, |
|---|
| 0 | + | {couch_httpd,handle_request_int,5}, |
|---|
| 0 | + | {couch_httpd_db,do_db_req,2}, |
|---|
| 0 | + | {couch_httpd,handle_request_int,5}, |
|---|
| 0 | + | {mochiweb_http,headers,5}, |
|---|
| 0 | + | {proc_lib,init_p_do_apply,3}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:51:55 GMT] [info] [<0.9453.3>] 127.0.0.1 - - 'POST' /test/_design/..?db=test 415 |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:51:55 GMT] [debug] [<0.9453.3>] httpd 415 error response: |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | # Executed command 1.4: |
|---|
| 0 | + | $ curl -d @example -H "Content-type:application/json" -e http://localhost:5984/test http://localhost:5984/test/randomid32420 |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | # Comment: I did this one just because - and I noticed that when you post with and ID - it wont accept JSON content type |
|---|
| 0 | + | |
|---|
| 0 | + | # LOG: |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:54:23 GMT] [debug] [<0.9490.3>] 'POST' /test/randomid32420 {1,1} |
|---|
| 0 | + | Headers: [{'Accept',"*/*"}, |
|---|
| 0 | + | {'Content-Length',"23"}, |
|---|
| 0 | + | {'Content-Type',"application/json"}, |
|---|
| 0 | + | {'Host',"localhost:5984"}, |
|---|
| 0 | + | {'Referer',"http://localhost:5984/test"}, |
|---|
| 0 | + | {'User-Agent',"curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:54:23 GMT] [debug] [<0.9490.3>] OAuth Params: [] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:54:23 GMT] [debug] [<0.9490.3>] Minor error in HTTP request: {bad_ctype, |
|---|
| 0 | + | |
|---|
| 0 | + | "Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:54:23 GMT] [debug] [<0.9490.3>] Stacktrace: [{couch_httpd,validate_ctype,2}, |
|---|
| 0 | + | {couch_httpd_db,db_doc_req,3}, |
|---|
| 0 | + | {couch_httpd_db,do_db_req,2}, |
|---|
| 0 | + | {couch_httpd,handle_request_int,5}, |
|---|
| 0 | + | {mochiweb_http,headers,5}, |
|---|
| 0 | + | {proc_lib,init_p_do_apply,3}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:54:23 GMT] [info] [<0.9490.3>] 127.0.0.1 - - 'POST' /test/randomid32420 415 |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 21:54:23 GMT] [debug] [<0.9490.3>] httpd 415 error response: |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | |
|---|
| 0 | + | |
|---|
| 0 | + | ---------------------------------------------------------------------------------------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | |
|---|
| 0 | + | ## Test 2: |
|---|
| 0 | + | |
|---|
| 0 | + | # Rewrites config: |
|---|
| 0 | + | [ |
|---|
| 0 | + | { |
|---|
| 0 | + | "to": "../../*", |
|---|
| 0 | + | "from": ":db/*" |
|---|
| 0 | + | } |
|---|
| 0 | + | ] |
|---|
| 0 | + | |
|---|
| 0 | + | # Executed command 2.1: |
|---|
| 0 | + | $ curl -d @example -H "Content-type:application/json" -e http://localhost:5984/test http://localhost:5984/test/ |
|---|
| 0 | + | {"ok":true,"id":"ce8b504d63666c9257cc07537c00af99","rev":"1-505a221d0aef5d664f29d6afdae01293"} |
|---|
| 0 | + | |
|---|
| 0 | + | # Comment: OK, everything is fine |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | #Executed command 2.2: |
|---|
| 0 | + | $ curl -X PUT -d @example -H "Content-type:application/json" http://localhost:5984/test/_design/test/_rewrite/test/randomid3125 |
|---|
| 0 | + | {"ok":true,"id":"randomid3125","rev":"1-505a221d0aef5d664f29d6afdae01293"} |
|---|
| 0 | + | |
|---|
| 0 | + | # Comment: OK, everything is fine - since now rewrite rule appropriately handles the ID. |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | #Executed command 2.3: |
|---|
| 0 | + | $ curl -d @example -H "Content-type:application/json" -e http://localhost:5984/test http://localhost:5984/test/_design/test/_rewrite/test/ |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | # Comment: Routing and content type are wrong (routing in PUT request - command 2.2 was done right!) |
|---|
| 0 | + | |
|---|
| 0 | + | # LOG: |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:06:17 GMT] [debug] [<0.10262.3>] 'POST' /test/_design/test/_rewrite/test/ {1,1} |
|---|
| 0 | + | Headers: [{'Accept',"*/*"}, |
|---|
| 0 | + | {'Content-Length',"23"}, |
|---|
| 0 | + | {'Content-Type',"application/json"}, |
|---|
| 0 | + | {'Host',"localhost:5984"}, |
|---|
| 0 | + | {'Referer',"http://localhost:5984/test"}, |
|---|
| 0 | + | {'User-Agent',"curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:06:17 GMT] [debug] [<0.10262.3>] OAuth Params: [] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:06:17 GMT] [debug] [<0.10262.3>] rewrite to "/test/_design/..?db=test" |
|---|
| 0 | + | |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:06:17 GMT] [debug] [<0.10262.3>] 'POST' /test/_design/..?db=test {1,1} |
|---|
| 0 | + | Headers: [{'Accept',"*/*"}, |
|---|
| 0 | + | {'Content-Length',"23"}, |
|---|
| 0 | + | {'Content-Type',"application/json"}, |
|---|
| 0 | + | {'Host',"localhost:5984"}, |
|---|
| 0 | + | {'Referer',"http://localhost:5984/test"}, |
|---|
| 0 | + | {'User-Agent',"curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:06:17 GMT] [debug] [<0.10262.3>] OAuth Params: [{"db","test"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:06:17 GMT] [debug] [<0.10262.3>] Minor error in HTTP request: {bad_ctype, |
|---|
| 0 | + | |
|---|
| 0 | + | "Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:06:17 GMT] [debug] [<0.10262.3>] Stacktrace: [{couch_httpd,validate_ctype,2}, |
|---|
| 0 | + | {couch_httpd_db,db_doc_req,3}, |
|---|
| 0 | + | {couch_httpd_db,do_db_req,2}, |
|---|
| 0 | + | {couch_httpd,handle_request_int,5}, |
|---|
| 0 | + | {couch_httpd_db,do_db_req,2}, |
|---|
| 0 | + | {couch_httpd,handle_request_int,5}, |
|---|
| 0 | + | {mochiweb_http,headers,5}, |
|---|
| 0 | + | {proc_lib,init_p_do_apply,3}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:06:17 GMT] [info] [<0.10262.3>] 127.0.0.1 - - 'POST' /test/_design/..?db=test 415 |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:06:17 GMT] [debug] [<0.10262.3>] httpd 415 error response: |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | #Executed command 2.4: |
|---|
| 0 | + | $ curl -d @example -H "Content-type:application/json" -e http://localhost:5984/test http://localhost:5984/test/randomid32843 |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | #Comment: No routing information in log, got Cotent type error. |
|---|
| 0 | + | |
|---|
| 0 | + | #LOG: |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:11:53 GMT] [debug] [<0.10377.3>] 'POST' /test/randomid32843 {1,1} |
|---|
| 0 | + | Headers: [{'Accept',"*/*"}, |
|---|
| 0 | + | {'Content-Length',"23"}, |
|---|
| 0 | + | {'Content-Type',"application/json"}, |
|---|
| 0 | + | {'Host',"localhost:5984"}, |
|---|
| 0 | + | {'Referer',"http://localhost:5984/test"}, |
|---|
| 0 | + | {'User-Agent',"curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:11:53 GMT] [debug] [<0.10377.3>] OAuth Params: [] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:11:53 GMT] [debug] [<0.10377.3>] Minor error in HTTP request: {bad_ctype, |
|---|
| 0 | + | |
|---|
| 0 | + | "Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:11:53 GMT] [debug] [<0.10377.3>] Stacktrace: [{couch_httpd,validate_ctype,2}, |
|---|
| 0 | + | {couch_httpd_db,db_doc_req,3}, |
|---|
| 0 | + | {couch_httpd_db,do_db_req,2}, |
|---|
| 0 | + | {couch_httpd,handle_request_int,5}, |
|---|
| 0 | + | {mochiweb_http,headers,5}, |
|---|
| 0 | + | {proc_lib,init_p_do_apply,3}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:11:53 GMT] [info] [<0.10377.3>] 127.0.0.1 - - 'POST' /test/randomid32843 415 |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:11:53 GMT] [debug] [<0.10377.3>] httpd 415 error response: |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | ---------------------------------------------------------------------------------------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | |
|---|
| 0 | + | ## Test 3: |
|---|
| 0 | + | |
|---|
| 0 | + | # Rewrites config: |
|---|
| 0 | + | [ |
|---|
| 0 | + | { |
|---|
| 0 | + | "to": "../../*", |
|---|
| 0 | + | "from": ":db/*" |
|---|
| 0 | + | }, |
|---|
| 0 | + | { |
|---|
| 0 | + | "to": "../..", |
|---|
| 0 | + | "from": ":db" |
|---|
| 0 | + | } |
|---|
| 0 | + | ] |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | # Executed command 3.1: |
|---|
| 0 | + | $ curl -d @example -H "Content-type:application/json" -e http://localhost:5984/test http://localhost:5984/test/ |
|---|
| 0 | + | {"ok":true,"id":"ce8b504d63666c9257cc07537c00bbe3","rev":"1-505a221d0aef5d664f29d6afdae01293"} |
|---|
| 0 | + | |
|---|
| 0 | + | # Comment: OK! works as expected |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | #Executed command 3.2: |
|---|
| 0 | + | $ curl -X PUT -d @example -H "Content-type:application/json" http://localhost:5984/test/_design/test/_rewrite/test/randomid43242 |
|---|
| 0 | + | {"ok":true,"id":"randomid43242","rev":"1-505a221d0aef5d664f29d6afdae01293"} |
|---|
| 0 | + | |
|---|
| 0 | + | # Comment: OK! works as expected |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | #Executed command 3.3: |
|---|
| 0 | + | $ curl -d @example -H "Content-type:application/json" -e http://localhost:5984/test http://localhost:5984/test/_design/test/_rewrite/test/ |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | # Comment: Rewrite issue and content type issue |
|---|
| 0 | + | |
|---|
| 0 | + | # LOG: |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:19:55 GMT] [debug] [<0.11199.3>] 'POST' /test/_design/test/_rewrite/test/ {1,1} |
|---|
| 0 | + | Headers: [{'Accept',"*/*"}, |
|---|
| 0 | + | {'Content-Length',"23"}, |
|---|
| 0 | + | {'Content-Type',"application/json"}, |
|---|
| 0 | + | {'Host',"localhost:5984"}, |
|---|
| 0 | + | {'Referer',"http://localhost:5984/test"}, |
|---|
| 0 | + | {'User-Agent',"curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:19:55 GMT] [debug] [<0.11199.3>] OAuth Params: [] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:19:55 GMT] [debug] [<0.11199.3>] rewrite to "/test/_design/..?db=test" |
|---|
| 0 | + | |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:19:55 GMT] [debug] [<0.11199.3>] 'POST' /test/_design/..?db=test {1,1} |
|---|
| 0 | + | Headers: [{'Accept',"*/*"}, |
|---|
| 0 | + | {'Content-Length',"23"}, |
|---|
| 0 | + | {'Content-Type',"application/json"}, |
|---|
| 0 | + | {'Host',"localhost:5984"}, |
|---|
| 0 | + | {'Referer',"http://localhost:5984/test"}, |
|---|
| 0 | + | {'User-Agent',"curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:19:55 GMT] [debug] [<0.11199.3>] OAuth Params: [{"db","test"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:19:55 GMT] [debug] [<0.11199.3>] Minor error in HTTP request: {bad_ctype, |
|---|
| 0 | + | |
|---|
| 0 | + | "Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:19:55 GMT] [debug] [<0.11199.3>] Stacktrace: [{couch_httpd,validate_ctype,2}, |
|---|
| 0 | + | {couch_httpd_db,db_doc_req,3}, |
|---|
| 0 | + | {couch_httpd_db,do_db_req,2}, |
|---|
| 0 | + | {couch_httpd,handle_request_int,5}, |
|---|
| 0 | + | {couch_httpd_db,do_db_req,2}, |
|---|
| 0 | + | {couch_httpd,handle_request_int,5}, |
|---|
| 0 | + | {mochiweb_http,headers,5}, |
|---|
| 0 | + | {proc_lib,init_p_do_apply,3}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:19:55 GMT] [info] [<0.11199.3>] 127.0.0.1 - - 'POST' /test/_design/..?db=test 415 |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:19:55 GMT] [debug] [<0.11199.3>] httpd 415 error response: |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | --------------------- |
|---|
| 0 | + | |
|---|
| 0 | + | #Executed command 3.4: |
|---|
| 0 | + | $ curl -d @example -H "Content-type:application/json" -e http://localhost:5984/test http://localhost:5984/test/randomid432432 |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | #Comment: Obviously no rewrite issue, however content type problem is there |
|---|
| 0 | + | |
|---|
| 0 | + | #LOG: |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:21:24 GMT] [debug] [<0.11220.3>] 'POST' /test/randomid432432 {1,1} |
|---|
| 0 | + | Headers: [{'Accept',"*/*"}, |
|---|
| 0 | + | {'Content-Length',"23"}, |
|---|
| 0 | + | {'Content-Type',"application/json"}, |
|---|
| 0 | + | {'Host',"localhost:5984"}, |
|---|
| 0 | + | {'Referer',"http://localhost:5984/test"}, |
|---|
| 0 | + | {'User-Agent',"curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18"}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:21:24 GMT] [debug] [<0.11220.3>] OAuth Params: [] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:21:24 GMT] [debug] [<0.11220.3>] Minor error in HTTP request: {bad_ctype, |
|---|
| 0 | + | |
|---|
| 0 | + | "Content-Type must be multipart/form-data"} |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:21:24 GMT] [debug] [<0.11220.3>] Stacktrace: [{couch_httpd,validate_ctype,2}, |
|---|
| 0 | + | {couch_httpd_db,db_doc_req,3}, |
|---|
| 0 | + | {couch_httpd_db,do_db_req,2}, |
|---|
| 0 | + | {couch_httpd,handle_request_int,5}, |
|---|
| 0 | + | {mochiweb_http,headers,5}, |
|---|
| 0 | + | {proc_lib,init_p_do_apply,3}] |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:21:24 GMT] [info] [<0.11220.3>] 127.0.0.1 - - 'POST' /test/randomid432432 415 |
|---|
| 0 | + | |
|---|
| 0 | + | [Mon, 10 Jan 2011 22:21:24 GMT] [debug] [<0.11220.3>] httpd 415 error response: |
|---|
| 0 | + | {"error":"bad_content_type","reason":"Content-Type must be multipart/form-data"} |
|---|
| ... | |
|---|