Tony Sun [Fri, 22 Apr 2016 06:03:01 +0000 (23:03 -0700)]
Add more tests
COUCHDB-2992
Tony Sun [Fri, 22 Apr 2016 01:46:07 +0000 (18:46 -0700)]
Add check for _update handlers
COUCHDB-2992
Tony Sun [Fri, 22 Apr 2016 01:42:51 +0000 (18:42 -0700)]
Add in check for body size in multi_part requests
COUCHDB-2992
Tony Sun [Wed, 20 Apr 2016 22:38:49 +0000 (15:38 -0700)]
Use doc body after parsing
We use the #doc.body because we only care about the json body. Inline
attachments are already stripped away
COUCHDB-2992
Tony Sun [Wed, 20 Apr 2016 01:41:32 +0000 (18:41 -0700)]
Move max_document_size logic to update only
COUCHDB-2992
Tony Sun [Sun, 17 Apr 2016 02:42:46 +0000 (19:42 -0700)]
Add support for single_max_doc
This adds support for a new configuration param single_max_doc_size.
Single documents that exceed this document will receive a too_large
error.
COUCHDB-2992
ILYA Khlopotov [Fri, 15 Apr 2016 18:32:30 +0000 (11:32 -0700)]
Merge remote branch 'github/pr/109'
This closes #109
Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
ILYA Khlopotov [Mon, 21 Mar 2016 20:06:28 +0000 (13:06 -0700)]
Add `log_format_test` test case
COUCHDB-2973
ILYA Khlopotov [Mon, 21 Mar 2016 19:23:31 +0000 (12:23 -0700)]
Log user name of request initiator
Change the log format from chttpd to include username.
The new format is (space separated):
Nonce, Peer, Host, UserName, Method, RawUri, Code, Status, RequestTime
COUCHDB-2973
Eric Avdey [Tue, 12 Apr 2016 18:39:29 +0000 (15:39 -0300)]
Reject incorrectly encoded urls
COUCHDB-2748
Robert Newson [Tue, 12 Apr 2016 15:39:44 +0000 (16:39 +0100)]
tolerate failure when inserting auth ddoc
COUCHDB-2986
Garren Smith [Thu, 7 Apr 2016 13:47:05 +0000 (15:47 +0200)]
Create md5 etag for _local docs
This makes a unique ETAG for _local docs, so that they are cached
correctly, and fetched again when the document changes.
fixes COUCHDB-2978
ILYA Khlopotov [Tue, 22 Mar 2016 12:33:56 +0000 (05:33 -0700)]
Merge remote branch 'github/pr/108'
This closes #108
Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
ILYA Khlopotov [Thu, 17 Mar 2016 17:59:01 +0000 (10:59 -0700)]
Use couch_tests:setup/1
ILYA Khlopotov [Thu, 17 Mar 2016 17:36:53 +0000 (10:36 -0700)]
Use couch_tests applications for chttpd_plugin_tests
ILYA Khlopotov [Tue, 15 Mar 2016 17:44:42 +0000 (10:44 -0700)]
Merge remote branch 'github/pr/106'
This closes #106
Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
ILYA Khlopotov [Tue, 8 Mar 2016 20:30:00 +0000 (12:30 -0800)]
Add test suite for chttpd_plugin
COUCHDB-2966
ILYA Khlopotov [Tue, 8 Mar 2016 18:46:17 +0000 (10:46 -0800)]
Add chttpd_plugin:before_serve_file/5 EPI hook
COUCHDB-2966
ILYA Khlopotov [Tue, 8 Mar 2016 18:24:49 +0000 (10:24 -0800)]
Introduce chttpd_plugin:before_response/4 EPI hook
COUCHDB-2966
ILYA Khlopotov [Tue, 8 Mar 2016 16:57:55 +0000 (08:57 -0800)]
Extract handle_response function
COUCHDB-2966
ILYA Khlopotov [Tue, 8 Mar 2016 16:32:24 +0000 (08:32 -0800)]
Extract basic_headers/2 function
COUCHDB-2966
Alexander Shorin [Sun, 6 Mar 2016 14:15:15 +0000 (17:15 +0300)]
Cache favicon for one year
Robert Kowalski [Thu, 3 Sep 2015 14:10:20 +0000 (16:10 +0200)]
Backport CSP fix from couchdb-couch
Needed for the ace editor icons
See https://github.com/apache/couchdb-couch/pull/2
This closes #68
Jay Doane [Mon, 14 Mar 2016 03:51:05 +0000 (20:51 -0700)]
Eliminate unnecessary apply
ILYA Khlopotov [Tue, 8 Mar 2016 18:32:32 +0000 (10:32 -0800)]
Merge remote branch 'github/pr/105'
This closes #105
Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
ILYA Khlopotov [Tue, 8 Mar 2016 17:59:38 +0000 (09:59 -0800)]
Fix dispatch to handle_error EPI hook
ILYA Khlopotov [Thu, 3 Mar 2016 20:01:54 +0000 (12:01 -0800)]
Merge remote branch 'github/pr/101'
This closes #101
Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
ILYA Khlopotov [Thu, 3 Mar 2016 16:07:38 +0000 (08:07 -0800)]
Suppress log of a response for clustered interface
COUCHDB-2945
ILYA Khlopotov [Tue, 9 Feb 2016 22:41:22 +0000 (14:41 -0800)]
Treat value passed in Origin as case sensitive
According to CORS spec here https://www.w3.org/TR/cors
The value of the Origin header is not a case-sensitive
COUCHDB-2945
ILYA Khlopotov [Tue, 16 Feb 2016 23:23:37 +0000 (15:23 -0800)]
Strip scheme out of Host for cors_section
Value returned by `couch_httpd_vhost:host/1` might not contain scheme.
The cors section is named after vhost name (i.e. without scheme).
For example:
[cors:partner.com]
methods =
headers =
exposed_headers =
origins = http://restricted.dev:8000
The origin in origins has to be given with scheme included.
COUCHDB-2945
ILYA Khlopotov [Tue, 9 Feb 2016 21:22:05 +0000 (13:22 -0800)]
Introduce vhosts configuration into CORS
In order to remove code duplication we move vhosts support
from couch_http_cors into chttpd_cors. We also dispatch
chttpd:send_response to couch_http which does call chttpd_cors:headers.
In order to avoid double injection of CORS headers we check for existance of
"Access-Control-Allow-Origin" in response headers.
COUCHDB-2945
Alexander Shorin [Tue, 2 Feb 2016 15:23:06 +0000 (18:23 +0300)]
Merge remote-tracking branch 'github/pr/100'
ILYA Khlopotov [Thu, 28 Jan 2016 23:39:30 +0000 (15:39 -0800)]
Convert all CORS headers config into lowercase
ILYA Khlopotov [Mon, 25 Jan 2016 21:07:19 +0000 (13:07 -0800)]
Adding more tests for CORS
ILYA Khlopotov [Mon, 25 Jan 2016 21:06:39 +0000 (13:06 -0800)]
Introduce cors/exposed_headers config setting
ILYA Khlopotov [Mon, 25 Jan 2016 21:05:47 +0000 (13:05 -0800)]
Make use of <<allow_headers>> option
ILYA Khlopotov [Mon, 25 Jan 2016 21:04:06 +0000 (13:04 -0800)]
Use correct setting for AllowHeaders
Alexander Shorin [Sun, 3 Jan 2016 17:17:29 +0000 (20:17 +0300)]
Don't crash on unknown request method
Alexander Shorin [Wed, 18 Nov 2015 18:37:41 +0000 (21:37 +0300)]
Ask cassim for secObj value
ermouth [Fri, 2 Oct 2015 11:00:53 +0000 (14:00 +0300)]
Rewrite via query server
COUCHDB-2874
Robert Newson [Sun, 20 Dec 2015 18:39:36 +0000 (18:39 +0000)]
fix conflict case - COUCHDB-2082
Robert Newson [Sun, 20 Dec 2015 18:15:21 +0000 (18:15 +0000)]
Create _design/_auth if missing in clustered users db
This also fixes a crash if the _users db had any design documents in it.
COUCHDB-2082
Jan Lehnardt [Fri, 18 Dec 2015 10:51:09 +0000 (11:51 +0100)]
Merge branch '1.x-compat'
* 1.x-compat:
1.x compat: update fun: allow docs with slash in id
1.x compat: parse form data for externals on PUT in addtion ot POST
Jan Lehnardt [Sat, 12 Dec 2015 14:14:37 +0000 (15:14 +0100)]
1.x compat: update fun: allow docs with slash in id
Jan Lehnardt [Sat, 12 Dec 2015 14:09:01 +0000 (15:09 +0100)]
1.x compat: parse form data for externals on PUT in addtion ot POST
Alexander Shorin [Sat, 8 Aug 2015 16:20:56 +0000 (19:20 +0300)]
Provide information about actual request path when vhost is used
ILYA Khlopotov [Thu, 19 Nov 2015 18:11:25 +0000 (10:11 -0800)]
Get rid of confusing function
ILYA Khlopotov [Thu, 19 Nov 2015 18:10:39 +0000 (10:10 -0800)]
Refactor logging statement
ILYA Khlopotov [Thu, 19 Nov 2015 18:09:52 +0000 (10:09 -0800)]
Drop R14 support
ILYA Khlopotov [Wed, 18 Nov 2015 16:25:39 +0000 (08:25 -0800)]
Handle errors from before_request/after_request
This refactoring fixes the handling of errors from before_request.
Unify how we deal with errors among before_request and handle_request.
Alexander Shorin [Tue, 10 Nov 2015 22:17:36 +0000 (01:17 +0300)]
Fix compilation warning
Klaus Trainer [Mon, 2 Nov 2015 22:12:04 +0000 (23:12 +0100)]
Fix return types of responses to view requests
This fixes an issue that was introduced with
72258e2 and
e5b1aee.
Background:
Although all things still seemed to work, each request to a view
generated an exception with the following stack trace:
```
exception error: undefined function vacc:get/2
in function chttpd:result/2 (src/chttpd.erl, line 297)
in call from chttpd:handle_request_int/1 (src/chttpd.erl, line 276)
in call from mochiweb_http:headers/6 (src/mochiweb_http.erl, line 122)
```
Klaus Trainer [Mon, 2 Nov 2015 20:22:26 +0000 (21:22 +0100)]
Don't set random ETag header for `_all_docs` view
This fixes the issue that by setting a random ETag header, we implicitly
promised that there's a chance of a cache hit where there was no chance.
For 2.0, we simply remove the random ETag without replacement, in order
to not accidentally cause useless cache bloat in clients.
COUCHDB-2859
Klaus Trainer [Mon, 2 Nov 2015 17:33:19 +0000 (18:33 +0100)]
Don't set random ETag header for views
This fixes the issue that by setting a random ETag header, we implicitly
promised that there's a chance of a cache hit where there was no chance.
For 2.0, we simply remove the random ETag without replacement, in order
to not accidentally cause useless cache bloat in clients.
COUCHDB-2859
Jay Doane [Mon, 2 Nov 2015 00:59:32 +0000 (16:59 -0800)]
Explicitly create admin user and authenticate requests in chttpd_db_test cases
COUCHDB-2865
BugzID: 55502
Alexander Shorin [Thu, 29 Oct 2015 00:38:52 +0000 (03:38 +0300)]
Fix Last-Event-ID header handling for db changes feed
This assumes Last-Event-ID header value to be opaque.
COUCHDB-2858
Alexander Shorin [Thu, 29 Oct 2015 00:06:45 +0000 (03:06 +0300)]
Accept OPTIONS requests to list functions
COUCHDB-2850
Alexander Shorin [Wed, 28 Oct 2015 22:07:26 +0000 (01:07 +0300)]
Restore HTTP 301 response for /db/_design%2fddoc/* resources
This also fixes bug that existed in 1.x when escape sequence
represented in uppercase: then we send wrong Location header
back to user causing HTTP 404 result.
COUCHDB-2674
Alexander Shorin [Tue, 27 Oct 2015 20:59:03 +0000 (23:59 +0300)]
Update /_replicate handler and clean it from legacy decisions
It's not actual anymore to have try/catch around replicate/2 as it never
throws any errors making catch block is actually unreached for
the specified clauses.
We also shouldn't repeat our self in error response rendering here.
Alexander Shorin [Thu, 22 Oct 2015 19:25:21 +0000 (22:25 +0300)]
Backport content negotiation from couch_httpd_*
COUCHDB-2409
Alexander Shorin [Tue, 27 Oct 2015 19:32:54 +0000 (22:32 +0300)]
Merge remote-tracking branch 'github/pr/81'
Alexander Shorin [Tue, 27 Oct 2015 13:23:22 +0000 (16:23 +0300)]
Fix replication when source/target are URLs
Commit
895715a6 introduced a bug when we quote all the values
while we only need to escape values that references to local
databases.
Alexander Shorin [Thu, 22 Oct 2015 18:27:04 +0000 (21:27 +0300)]
Fix start_couch test helper
Alexander Shorin [Tue, 20 Oct 2015 18:13:39 +0000 (21:13 +0300)]
Escape database name on POST /_replicate
COUCHDB-2666
Alexander Shorin [Tue, 20 Oct 2015 18:04:31 +0000 (21:04 +0300)]
Use real chttpd port for URI construct
Those port that we get from config works fine until we start to ask
for a random port.
Alexander Shorin [Thu, 15 Oct 2015 20:17:41 +0000 (23:17 +0300)]
Use new couch_httpd_multipart API
Alexander Shorin [Thu, 15 Oct 2015 19:53:12 +0000 (22:53 +0300)]
Fix multipart stream refactor
Alexander Shorin [Thu, 15 Oct 2015 16:36:41 +0000 (19:36 +0300)]
Merge remote-tracking branch 'github/pr/11'
ILYA Khlopotov [Fri, 9 Oct 2015 20:51:24 +0000 (13:51 -0700)]
Use couch_epi:decide/5 for authenticate/authorize
Robert Newson [Thu, 8 Oct 2015 12:14:02 +0000 (13:14 +0100)]
Call parse_revs
COUCHDB-2845
Robert Kowalski [Thu, 8 Oct 2015 09:36:56 +0000 (11:36 +0200)]
remove dead code
i keep running into this but it is not used anywhere
PR: #79
PR-URL: https://github.com/apache/couchdb-chttpd/pull/79
Reviewed-By: Robert Newson <rnewson@apache.org>
Alexander Shorin [Wed, 7 Oct 2015 21:02:19 +0000 (00:02 +0300)]
Make sure that database was created and deleted successfully
Alexander Shorin [Thu, 1 Oct 2015 17:53:29 +0000 (20:53 +0300)]
Merge remote-tracking branch 'github/pr/78'
Alexander Shorin [Thu, 1 Oct 2015 17:50:26 +0000 (20:50 +0300)]
Update .travis.yml
ILYA Khlopotov [Thu, 1 Oct 2015 17:40:16 +0000 (10:40 -0700)]
Remove chttpd_handlers:provider
`provider` function is no longer needed since providers defined by
couch_epi_plugin behaviour.
Robert Newson [Thu, 1 Oct 2015 15:05:34 +0000 (16:05 +0100)]
Merge remote-tracking branch 'cloudant/simplify_couch_epi'
Robert Newson [Thu, 1 Oct 2015 13:55:09 +0000 (14:55 +0100)]
Properly escape Location: HTTP header
Non-ASCII characters in the "Location:" header must be URL-encoded. This
can happen if a document is inserted with a user-defined "_id"
containing non-ASCII characters or if a filename contains non-ASCII
characters.
COUCHDB-2673
ILYA Khlopotov [Tue, 29 Sep 2015 20:04:19 +0000 (13:04 -0700)]
Pass supervisor's children to couch_epi
ILYA Khlopotov [Mon, 28 Sep 2015 16:47:02 +0000 (09:47 -0700)]
Update to new couch_epi API
Robert Newson [Fri, 25 Sep 2015 11:06:45 +0000 (12:06 +0100)]
Merge remote-tracking branch 'cloudant/2825-crypto-deprecations'
Robert Newson [Thu, 24 Sep 2015 11:10:20 +0000 (12:10 +0100)]
Lager is optional, don't start it here
Robert Newson [Wed, 23 Sep 2015 18:29:54 +0000 (19:29 +0100)]
Fix crypto deprecations
COUCHDB-2825
Robert Newson [Wed, 23 Sep 2015 12:50:36 +0000 (13:50 +0100)]
Fix test broken by 'Use illegal_docid error for really bad document ids'
Alexander Shorin [Thu, 17 Sep 2015 20:09:45 +0000 (23:09 +0300)]
Use illegal_docid error for really bad document ids
Robert Newson [Mon, 21 Sep 2015 22:40:11 +0000 (23:40 +0100)]
Reject database names that cause enametoolong error
COUCHDB-2821
Alexander Shorin [Wed, 22 Apr 2015 18:30:47 +0000 (21:30 +0300)]
Implement /db/_bulk_get endpoint
COUCHDB-2310
Robert Newson [Thu, 17 Sep 2015 17:34:41 +0000 (18:34 +0100)]
remove tabs
Nick Vatamaniuc [Wed, 16 Sep 2015 20:48:20 +0000 (16:48 -0400)]
POST to /{db}/_all_docs with invalid keys should return 400
Now they return 500. Since there is nothing wrong on the 500,
400 is more appropriate.
For example, turns requests like these:
http -a adm:pass POST http://127.0.0.1:15984/db1/_all_docs keys:='["1",2]'
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"error": "2",
"reason": "{illegal_docid,2}"
}
Into:
http -a adm:pass POST http://127.0.0.1:15984/db1/_all_docs keys:='["1",2]'
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "illegal_docid",
"reason": 2
}
COUCHDB-2815
Robert Newson [Sat, 12 Sep 2015 18:30:20 +0000 (19:30 +0100)]
Revert "add clusterwide compaction for dbs"
This reverts commit
994f132fd0923223ec7fd0802288fc2814bcc634.
Robert Newson [Thu, 10 Sep 2015 11:29:23 +0000 (12:29 +0100)]
Remove new CSRF mechanism
ILYA Khlopotov [Wed, 9 Sep 2015 16:28:01 +0000 (09:28 -0700)]
Fix usage of lists:keyreplace
Robert Newson [Tue, 8 Sep 2015 12:50:31 +0000 (13:50 +0100)]
Don't insert nil into lru
Robert Newson [Tue, 8 Sep 2015 12:49:18 +0000 (13:49 +0100)]
remove tabs
Robert Newson [Wed, 2 Sep 2015 18:34:25 +0000 (19:34 +0100)]
Merge remote-tracking branch 'cloudant/2796-improve_performance_of_providers_function'
ILYA Khlopotov [Wed, 2 Sep 2015 16:50:41 +0000 (09:50 -0700)]
Register service
COUCHDB-2796
ILYA Khlopotov [Wed, 2 Sep 2015 16:50:08 +0000 (09:50 -0700)]
Use ?SERVICE_ID macro
COUCHDB-2796
Robert Newson [Wed, 2 Sep 2015 15:30:18 +0000 (16:30 +0100)]
Merge remote-tracking branch 'cloudant/2775-post-valid-json-header'
ILYA Khlopotov [Tue, 1 Sep 2015 13:25:12 +0000 (06:25 -0700)]
Remove `ignore_providers` option
COUCHDB-2796
Robert Newson [Fri, 28 Aug 2015 12:57:09 +0000 (13:57 +0100)]
Merge remote-tracking branch 'cloudant/2788-fix-override'
Robert Newson [Thu, 27 Aug 2015 20:29:55 +0000 (21:29 +0100)]
Capture histogram data for _bulk_requests
COUCHDB-2792