[ 
https://issues.apache.org/jira/browse/OLINGO-839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15062117#comment-15062117
 ] 

Christian Amend commented on OLINGO-839:
----------------------------------------

Hi Gyula,

thanks for that analysis. This made the fix far easier. I have made a change 
which will prevent this from happening if anything in the URI is wrong. See my 
commit here: 
https://git-wip-us.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=4facec58b7f536501d0078908877979113874568

Unfortunately I couldn`t do anything to prevent cases like /Suppliers%2 since 
these kind of requests are blocked by the application server before they even 
reach the Olingo library. You will get a 400 status code but no reponse body.

If you are satisfied with the solution please close the issue :)

Best Regards,
Christian

> Invalid URL may return http status code 500 instead of 400
> ----------------------------------------------------------
>
>                 Key: OLINGO-839
>                 URL: https://issues.apache.org/jira/browse/OLINGO-839
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>    Affects Versions: V2 2.0.5
>            Reporter: Gyula Árpád Tóth
>            Assignee: Christian Amend
>            Priority: Minor
>             Fix For: V2 2.0.6
>
>         Attachments: 0001-OLINGO-839-Broken-URL-response.patch
>
>
> Broken urls like: 
> http://services.odata.org/OData/OData.svc/Suppliers?$filter=Address/City%20eq%20%27Redmond%2
>  should set the http status code to 400. In olingov2 the status code is set 
> 500, because once the url parsing failed, in the ODataExceptionWrapper the 
> url is parsed again and failed again, resulting in status code 500.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to