REST Service: whitespace in tokens causes error

Bug #653771 reported by Ronald Haentjens Dekker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
collatex
Fix Committed
Medium
Gregor Middell

Bug Description

Usage of whitespace in tokens sent to the collator through the REST API causes an error.

CollateX release version: 0.9

This bug was originally reported by Vincent Neyt.
This bug was also reported during the september bootcamp by Alexander Czmiel.

A temporary fix is preprocessing the tokens to delete the whitespaces.

Original bugreport by Vincent Neyt (in Dutch) follows:

>> Een iets is me al opgevallen bij het testen: de JSON string is heel
>> streng wat whitespace betreft, dit bijvoorbeeld:
>>
>> {"witnesses":[{"id":"xxx","content":" hallo" ...
>>
>> geeft een empty error, wegens de spatie tussen " en hallo. Dit
>> probleem heb ik kunnen omzeilen door de JSON string eerst door een
>> javascript te sturen dat overal " gevolgd door spatie, vervangt door
>> gewoon " zonder spatie.
>>
>> Daarnaast had ik ook problemen met harde returns in de xml,
>> bijvoorbeeld:
>>
>> <seg>
>> hallo hallo
>> <pb/>
>> hallo
>> </seg>
>>
>> in JSON werd dat dan
>>
>> "hallo hallo
>> hallo"
>>
>> wat een error gaf. Deze witregels stonden daar voor de leesbaarheid
>> van de xml. Daarvoor heb ik uit mijn xml bestanden alle overbodige
>> harde returns weggehaald, waardoor collatex nu nergens nog een error
>> geeft.

Revision history for this message
Gregor Middell (gregor-middell) wrote :

Fixed in trunk. The REST layer checked for empty tokens and threw an exception in case it encountered one. Now they are passed through to the aligner.

Changed in collatex:
assignee: nobody → Gregor Middell (gregor-middell)
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Ronald Haentjens Dekker (ronald-dekker) wrote : RE: [Bug 653771] Re: REST Service: whitespace in tokens causes error

Hi Gregor,

Thanks! I will take a look at your code shortly.

Ronald

________________________________________
From: <email address hidden> [<email address hidden>] On Behalf Of Gregor Middell [<email address hidden>]
Sent: Tuesday, October 05, 2010 4:07 PM
To: Ronald Dekker
Subject: [Bug 653771] Re: REST Service: whitespace in tokens causes error

Fixed in trunk. The REST layer checked for empty tokens and threw an
exception in case it encountered one. Now they are passed through to the
aligner.

** Changed in: collatex
     Assignee: (unassigned) => Gregor Middell (gregor-middell)

** Changed in: collatex
   Importance: Undecided => Medium

** Changed in: collatex
       Status: New => Fix Committed

--
REST Service: whitespace in tokens causes error
https://bugs.launchpad.net/bugs/653771
You received this bug notification because you are a direct subscriber
of the bug.

Status in CollateX - Collation of textual sources: Fix Committed

Bug description:
Usage of whitespace in tokens sent to the collator through the REST API causes an error.

CollateX release version: 0.9

This bug was originally reported by Vincent Neyt.
This bug was also reported during the september bootcamp by Alexander Czmiel.

A temporary fix is preprocessing the tokens to delete the whitespaces.

Original bugreport by Vincent Neyt (in Dutch) follows:

>> Een iets is me al opgevallen bij het testen: de JSON string is heel
>> streng wat whitespace betreft, dit bijvoorbeeld:
>>
>> {"witnesses":[{"id":"xxx","content":" hallo" ...
>>
>> geeft een empty error, wegens de spatie tussen " en hallo. Dit
>> probleem heb ik kunnen omzeilen door de JSON string eerst door een
>> javascript te sturen dat overal " gevolgd door spatie, vervangt door
>> gewoon " zonder spatie.
>>
>> Daarnaast had ik ook problemen met harde returns in de xml,
>> bijvoorbeeld:
>>
>> <seg>
>> hallo hallo
>> <pb/>
>> hallo
>> </seg>
>>
>> in JSON werd dat dan
>>
>> "hallo hallo
>> hallo"
>>
>> wat een error gaf. Deze witregels stonden daar voor de leesbaarheid
>> van de xml. Daarvoor heb ik uit mijn xml bestanden alle overbodige
>> harde returns weggehaald, waardoor collatex nu nergens nog een error
>> geeft.

To unsubscribe from this bug, go to:
https://bugs.launchpad.net/collatex/+bug/653771/+subscribe

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.