summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd.erl
AgeCommit message (Collapse)Author
2011-05-23Fix authentication. Jquery append "*.*" to accept byRobert Newson
default so if we test text/html first it will alway be true. Then test first if application/json was given and then test if text/html then others. Backported from trunk (related to COUCHDB-1175). git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1126759 13f79535-47bb-0310-9956-ffa450edef68
2011-04-21default SSL port is 6984.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1095642 13f79535-47bb-0310-9956-ffa450edef68
2011-04-14Merged revision 1092247 from trunkFilipe David Borba Manana
Include OTP minor release information in the Server header This is mostly to help diagnose issues that might be related to specific OTP releases. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1092251 13f79535-47bb-0310-9956-ffa450edef68
2011-02-01Backport COUCHDB-1008 from trunk (revision 1055592)Filipe David Borba Manana
The motivation for this backport is to prevent the "nodelay" option, under section "httpd", from reaching version 1.1. This patch introduces the "socket_options" configuration parameter which is more generic - it allows nodelay as well as other socket options to be specified. Not adding this patch to 1.1.x would imply still supporting the "nodelay" parameter in future releases to avoid breaking the configuration API. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1065922 13f79535-47bb-0310-9956-ffa450edef68
2011-01-17Merged revision 1058674 from trunkFilipe David Borba Manana
Avoid unnecessary conversion to binary Mochiweb accepts IO lists. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1059889 13f79535-47bb-0310-9956-ffa450edef68
2011-01-03Merged revision 1054740 from trunkFilipe David Borba Manana
Removed references to no longer used config parameters Closes COUCHDB-1007 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1054741 13f79535-47bb-0310-9956-ffa450edef68
2010-12-01Merged revision 1041103 from trunk:Filipe David Borba Manana
Proper verification of the accepted content types plus some code cleaning. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1041113 13f79535-47bb-0310-9956-ffa450edef68
2010-11-16After authentication, redirect to the path the user requested, notJan Lehnardt
the one that is used internally. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035581 13f79535-47bb-0310-9956-ffa450edef68
2010-11-10Support the keys parameter in GET requests.Paul Joseph Davis
You can now request a list of keys in the query string using a query string like: ?keys=["foo", "bar"] Your query string obviously needs to be properly escaped. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1033676 13f79535-47bb-0310-9956-ffa450edef68
2010-11-05HTTP proxy handler.Paul Joseph Davis
The second of two new features to replace the _externals protocols. This allows users to configure CouchDB to proxy requests to an external HTTP server. The external HTTP server is not required to be on the same host running CouchDB. The configuration looks like such: [httpd_global_handlers] _google = {couch_httpd_proxy, handle_proxy_req, <<"http://www.google.com">>} You can then hit this proxy at the url: http://127.0.0.1:5984/_google If you add any path after the proxy name, or make a request with a query string, those will be appended to the URL specified in the configuration. Ie: http://127.0.0.1:5984/_google/search?q=plankton would translate to: http://www.google.com/search?q=plankton Obviously, request bodies are handled as expected. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1031877 13f79535-47bb-0310-9956-ffa450edef68
2010-09-30Removing ?getv macros.Filipe David Borba Manana
With OTP releases up to R13B03 it's not possible to define a 2 macro functions with the same name and different arities. (Only allowed in R13B04 and R14). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1003025 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27Replacing calls to couch_util:get_value with ?getvFilipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001879 13f79535-47bb-0310-9956-ffa450edef68
2010-09-18Added peer information to debug message.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@998530 13f79535-47bb-0310-9956-ffa450edef68
2010-08-24Added configurable nodelay setting via the ini. Set [httpd] nodelay=true to ↵Damien F. Katz
enable the TCP_NODELAY option for the web server sockets, which means that even small amounts of data will be sent immediately. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@988360 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18COUCHDB-161 - support Range header for attachments.Robert Newson
Attachments are upgraded to support the Range header on compaction. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@986629 13f79535-47bb-0310-9956-ffa450edef68
2010-08-17don't export twice.. this warning was annoying.Benoit Chesneau
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@986437 13f79535-47bb-0310-9956-ffa450edef68
2010-08-17New vhost manager. allows dynamic add of vhosts without restart,Benoit Chesneau
wildcard in vhost and dynamic routing via pattern matching. Close #COUCHDB-855. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@986182 13f79535-47bb-0310-9956-ffa450edef68
2010-08-15add requested_path to the req so we know original path in shows/lists &Benoit Chesneau
updates function. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@985678 13f79535-47bb-0310-9956-ffa450edef68
2010-08-13more informative error messages on invalid jsonJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@985407 13f79535-47bb-0310-9956-ffa450edef68
2010-08-01Buf fix - proper RegExp matching to avoid having a case like "hhtml" being ↵Filipe David Borba Manana
considered as "html". git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@981348 13f79535-47bb-0310-9956-ffa450edef68
2010-08-01Bug fix - RegExp matching the atom 'undefined'.Filipe David Borba Manana
According to the HTTP 1.1 spec, if the Accept header is not specified by a client, it means the client accepts all media types. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@981341 13f79535-47bb-0310-9956-ffa450edef68
2010-07-26Add SSL support to CouchDB.Robert Newson
To enable SSL you need to do three things; 1) enable the httpsd daemon in local.ini (you can just uncomment the line). 2) supply your PEM-encoded cert and key files in the [ssl] section. 3) start CouchDB. CouchDB will now, in addition to handling HTTP on port 5984, accept SSL connections on port 6984. The patch itself adds SSL support by updating the local version of Mochiweb to the latest. The upstream release includes our local tweak to support large numbers and to handle Accept-Encoding headers. Our local Mochiweb fork changed the default idle timeout from 10 seconds to 5 minutes, and it was agreed on #irc to revert this change. The only tweaks to Mochiweb were in mochiweb.app.src (to record the git commit I built from) and the removal of Makefile (replaced by Makefile.am). Futon received many tweaks as we have 'http://' hardcoded all over. All such instances now use window.location.protocol + '//'. CouchDB received a tweak to use the right scheme in couch_httpd:absolute_uri (it now gets it from the Mochireq and not mochiweb_socket_server). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@979368 13f79535-47bb-0310-9956-ffa450edef68
2010-07-25send a basic-auth popup header if require_valid_user=true, to prevent lock-outJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@979070 13f79535-47bb-0310-9956-ffa450edef68
2010-07-19remove unguarded atom creation to prevent DOS attacks. closes COUCHDB-829John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@965667 13f79535-47bb-0310-9956-ffa450edef68
2010-07-06dont redirect endlessly when require_valid_user=trueJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@960975 13f79535-47bb-0310-9956-ffa450edef68
2010-06-25make the authentication redirect URL configurable. setting it to the empty ↵John Christopher Anderson
string yields the 0.11 behavior git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957805 13f79535-47bb-0310-9956-ffa450edef68
2010-06-24better error message for db names, closes COUCHDB-741 thanks FrankJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957613 13f79535-47bb-0310-9956-ffa450edef68
2010-06-24close COUCHDB-795 add X-HTTP-METHOD-OVERRIDE support. Thanks Brian JenkinsJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957610 13f79535-47bb-0310-9956-ffa450edef68
2010-06-24use JSON content type in replicator, require it in the _bulk_docs and other ↵John Christopher Anderson
POST apis git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957422 13f79535-47bb-0310-9956-ffa450edef68
2010-06-24send browsers to /_utils/session.html when they need to log inJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957407 13f79535-47bb-0310-9956-ffa450edef68
2010-06-12log HEAD requests as HEAD, not GET. COUCHDB-788Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@954045 13f79535-47bb-0310-9956-ffa450edef68
2010-06-10Code mods to support streaming attachment replication.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@953499 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06keep massive invalid json blobs out of the error logger, move them to debug logJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@951918 13f79535-47bb-0310-9956-ffa450edef68
2010-06-03More work to allow for streaming attachment replication.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@950865 13f79535-47bb-0310-9956-ffa450edef68
2010-06-02trailing whitespace pedantryJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@950545 13f79535-47bb-0310-9956-ffa450edef68
2010-06-01better tests for the vhost globals, fixed a bugJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@949912 13f79535-47bb-0310-9956-ffa450edef68
2010-05-19Renaming `jsonp = false` ini option to `allow_jsonp = false` to beJan Lehnardt
more clear about its intention. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@946474 13f79535-47bb-0310-9956-ffa450edef68
2010-05-19no newlines in .ini filesJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@946465 13f79535-47bb-0310-9956-ffa450edef68
2010-05-19jsonp callbacks are ignored unless jsonp is configured to trueJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@946400 13f79535-47bb-0310-9956-ffa450edef68
2010-05-13vhost_global_handlers bypass rewrite rules and are available in all vhostsJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@943764 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04use crypto:md5 when available. thx fdmanana. Closes COUCHDB-757Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@941033 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04use keysearch BIF to search ejson props. Closes COUCHDB-747Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@940708 13f79535-47bb-0310-9956-ffa450edef68
2010-04-07make max_concurrent_connections configurable via Randall Leeds / COUCHDB-705John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@931663 13f79535-47bb-0310-9956-ffa450edef68
2010-03-01fix issue COUCHDB-678 applying patch from Filipe Manana.Benoit Chesneau
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@917553 13f79535-47bb-0310-9956-ffa450edef68
2010-02-19use process state instead of config lookup to match vhostsJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@911938 13f79535-47bb-0310-9956-ffa450edef68
2010-02-19typoJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@911936 13f79535-47bb-0310-9956-ffa450edef68
2010-02-19Add virtual host handling.Jan Lehnardt
; To enable Virtual Hosts in CouchDB, add a vhost = path directive. All requests to ; the Virual Host will be redirected to the path. In the example below all requests ; to http://example.com/ are redirected to /database. ; If you run CouchDB on a specific port, include the port number in the vhost: ; example.com:5984 = /database [vhosts] ;example.com = /database/ git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@911935 13f79535-47bb-0310-9956-ffa450edef68
2010-02-03add default_fun and url_handlers to #http. It's useful for any customBenoit Chesneau
handler that need to use the http_handler and not only the db and design http handlers. Like for example in the rewriter. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@906111 13f79535-47bb-0310-9956-ffa450edef68
2010-02-02would have been strange to be abble ../../_changes and notBenoit Chesneau
../../../_uuids in rewriting. Instead using couch_httpd_db:handle_request we now use couch_httpd:handle_request. Add one more unitest to test it. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@905599 13f79535-47bb-0310-9956-ffa450edef68
2010-02-01fix unused variable warnings, remove unused code.Jan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@905438 13f79535-47bb-0310-9956-ffa450edef68