[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[4752] trunk



Revision: 4752
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4752&view=rev
Author:   einhverfr
Date:     2012-05-22 13:26:49 +0000 (Tue, 22 May 2012)
Log Message:
-----------
Adding version checking to REST handler, and updating the XML sample

Modified Paths:
--------------
    trunk/rest-handler.pl
    trunk/t/data/rest_samples/sample_customer.xml

Modified: trunk/rest-handler.pl
===================================================================
--- trunk/rest-handler.pl	2012-05-22 10:24:00 UTC (rev 4751)
+++ trunk/rest-handler.pl	2012-05-22 13:26:49 UTC (rev 4752)
@@ -251,6 +251,8 @@
     $request->{format} = $1;
 
     my @components = split /\//, $url;
+    my $version = shift @components;
+    die '400 Unsupported Version' if ($version ne '1.4');
 
     $request->{dbh} = DBI->connect(
         "dbi:Pg:dbname=$components[0]", 

Modified: trunk/t/data/rest_samples/sample_customer.xml
===================================================================
--- trunk/t/data/rest_samples/sample_customer.xml	2012-05-22 10:24:00 UTC (rev 4751)
+++ trunk/t/data/rest_samples/sample_customer.xml	2012-05-22 13:26:49 UTC (rev 4752)
@@ -9,12 +9,12 @@
        <location class_id='1' line_one='103 Park Road' city='Red City'
                  state='Washington' mail_code='97432' country_code='US' />
        <contact class='email' description='Accounts Payable'
-                contact='..hidden..' />
+                contact='..hidden..' />
        <note>This is a note about the customer account.</note>
    </eca>
    <eca meta_number='V123' pay_to='Examples, Inc' description='Example'
         start_date='2011-01-01' credit_limit='500' currency='USD'
-        terms='30' arap_accno='1200' cash_accno='1060' language='en_US'
+        terms='30' arap_accno='2100' cash_accno='1060' language='en_US'
         entity_class='1'>
    </eca>
    <note>This is a note about the entity and will show up on both accounts.

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.