Return-Path: Delivered-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Received: (qmail 87495 invoked from network); 29 Sep 2010 14:19:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Sep 2010 14:19:06 -0000 Received: (qmail 13666 invoked by uid 500); 29 Sep 2010 14:19:06 -0000 Delivered-To: apmail-incubator-deltacloud-dev-archive@incubator.apache.org Received: (qmail 13640 invoked by uid 500); 29 Sep 2010 14:19:06 -0000 Mailing-List: contact deltacloud-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltacloud-dev@incubator.apache.org Delivered-To: mailing list deltacloud-dev@incubator.apache.org Received: (qmail 13555 invoked by uid 99); 29 Sep 2010 14:19:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Sep 2010 14:19:05 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mfojtik@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Sep 2010 14:18:59 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8TEIdue017732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 Sep 2010 10:18:39 -0400 Received: from patashnik.brq.redhat.com (dhcp-2-247.brq.redhat.com [10.34.2.247]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8TEITJe007782 for ; Wed, 29 Sep 2010 10:18:38 -0400 From: mfojtik@redhat.com To: deltacloud-dev@incubator.apache.org Subject: [PATCH core 07/10] Preserving extension as part of ID Date: Wed, 29 Sep 2010 16:18:25 +0200 Message-Id: <1285769908-27056-8-git-send-email-mfojtik@redhat.com> In-Reply-To: <1285769908-27056-1-git-send-email-mfojtik@redhat.com> References: <1285769908-27056-1-git-send-email-mfojtik@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 From: Michal Fojtik --- server/lib/sinatra/respond_to.rb | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/server/lib/sinatra/respond_to.rb b/server/lib/sinatra/respond_to.rb index b4efac4..890890d 100644 --- a/server/lib/sinatra/respond_to.rb +++ b/server/lib/sinatra/respond_to.rb @@ -69,8 +69,7 @@ module Sinatra # Remove extension from URI # Extension will be available as a 'extension' method (extension=='txt') - request.path_info.sub! %r{\.([^\./]+)$}, '' - extension $1 + extension request.path_info.match(/\.([^\.\/]+)$/).to_a.first # If ?format= is present, ignore all Accept negotiations because # we are not dealing with browser -- 1.7.2.3