Petals BC REST

Invalid URL sent when a parameter of the URI template contains a space

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.1-BC
  • Fix Version/s: 1.1.0-BC
  • Component/s: Provider mode
  • Security Level: Public
  • Description:

    If the value of a URI template contains a space, the URL generated is not correctly encoded: the space is encoded with '+' instead of '%20'

  • Environment:
    -

Activity

Hide
Christophe DENEUX added a comment - Fri, 13 Jan 2017 - 18:36:13 +0100

Caution, different encoding must be applied according to the URL part:

  • one for the path part, where a space is encoded with '%20',
  • and another one for the query part, where space is encoded with '+'.
Show
Christophe DENEUX added a comment - Fri, 13 Jan 2017 - 18:36:13 +0100 Caution, different encoding must be applied according to the URL part:
  • one for the path part, where a space is encoded with '%20',
  • and another one for the query part, where space is encoded with '+'.
Hide
Christophe DENEUX added a comment - Fri, 13 Jan 2017 - 18:37:59 +0100

A first fix was commited by error with svn#41010 into the file 'RESTRequest.java'.

Unit tests must be added to check the encoding on path part and query part.

Show
Christophe DENEUX added a comment - Fri, 13 Jan 2017 - 18:37:59 +0100 A first fix was commited by error with svn#41010 into the file 'RESTRequest.java'. Unit tests must be added to check the encoding on path part and query part.
Hide
Christophe DENEUX added a comment - Fri, 13 Jan 2017 - 19:57:42 +0100

A unit test has been added in trunk to cjeck the encoding on URL query part. A unit test already exists on the encoding of URL path part.

Show
Christophe DENEUX added a comment - Fri, 13 Jan 2017 - 19:57:42 +0100 A unit test has been added in trunk to cjeck the encoding on URL query part. A unit test already exists on the encoding of URL path part.

People

Dates

  • Created:
    Fri, 13 Jan 2017 - 18:28:39 +0100
    Updated:
    Fri, 13 Jan 2017 - 19:57:42 +0100
    Resolved:
    Fri, 13 Jan 2017 - 19:57:42 +0100