From dev-return-7683-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Thu Dec 17 09:19:43 2009 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 67306 invoked from network); 17 Dec 2009 09:19:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Dec 2009 09:19:43 -0000 Received: (qmail 34492 invoked by uid 500); 17 Dec 2009 09:19:42 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 34425 invoked by uid 500); 17 Dec 2009 09:19:42 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 34414 invoked by uid 99); 17 Dec 2009 09:19:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2009 09:19:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2009 09:19:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D6036234C498 for ; Thu, 17 Dec 2009 01:19:18 -0800 (PST) Message-ID: <1058547927.1261041558861.JavaMail.jira@brutus> Date: Thu, 17 Dec 2009 09:19:18 +0000 (UTC) From: "Filipe Manana (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Updated: (COUCHDB-348) / should redirect to a human readable page when accessed from a browser In-Reply-To: <2070591586.1242067785569.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Filipe Manana updated COUCHDB-348: ---------------------------------- Attachment: encs.erl Matthew, regarding the of parsing Q values, I did it for a patch to 583. It was done for parsing the "Accept-Encoding" header, but it should be reusable for other Q values lists. I didn't find it in Mochiweb also :( I agree with yout, it's boring to do such a parsing function. I add it here in a separate file with test functions. The main function is build_enc_lists/1, which builds 2 lists, one for Q values > 0, and the other with Q values == 0. It ignores white spaces all over and it's case insensitive (as rfc 2626 says): test_build_lists() -> {[], []} = build_enc_lists(""), {[], [identity]} = build_enc_lists("identity;q=0"), {[], [identity]} = build_enc_lists("identity ;q=0"), {[], [identity]} = build_enc_lists(" identity; q =0 "), {[], [identity]} = build_enc_lists("identity ; q = 0"), {[], [identity]} = build_enc_lists("identity ; q= 0.0"), {[gzip, deflate], [identity]} = build_enc_lists("gzip,deflate,identity;q=0.0"), {[deflate, gzip], [identity]} = build_enc_lists("deflate,gzip,identity;q=0.0"), {[gzip, deflate, gzip], [identity]} = build_enc_lists("gzip,deflate,gzip,identity;q=0"), {[gzip, deflate], [identity]} = build_enc_lists("gzip, deflate , identity; q=0.0"), {[gzip, deflate], [identity]} = build_enc_lists("gzip; q=1, deflate;q=1.0, identity;q=0.0"), {[deflate, gzip], [identity]} = build_enc_lists("gzip; q=0.5, deflate;q=1.0, identity;q=0"), {[deflate, gzip], [identity]} = build_enc_lists("gzip; q=0.5, deflate , identity;q=0.0"), {[deflate, gzip], [identity]} = build_enc_lists("gzip; q=0.5, deflate;q=0.8, identity;q=0.0"), {[deflate, identity, gzip], []} = build_enc_lists("gzip; q=0.5,deflate,identity"), {[deflate, identity, identity, gzip], []} = build_enc_lists("gzip; q=0.5,deflate,identity, identity "), ok. cheers > / should redirect to a human readable page when accessed from a browser > ----------------------------------------------------------------------- > > Key: COUCHDB-348 > URL: https://issues.apache.org/jira/browse/COUCHDB-348 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface > Reporter: Chris Anderson > Fix For: 0.11 > > Attachments: COUCHDB_348_01.patch, COUCHDB_348_02.patch, COUCHDB_348_03.patch, encs.erl > > > As more people are adopting CouchDB, the number of questions along the lines of "All I see is {"couchdb":"Welcome","version":"0.10.0a773399"}, what now?" > If this page redirected to /_utils/ (or maybe something more user-focussed) when the accept headers included html, we could make the first-time user experience more palatable. > There's some code in COUCHDB-234 that might be helpful here. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.