You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Sandeep (Jira)" <ji...@apache.org> on 2022/02/16 05:24:00 UTC

[jira] [Resolved] (FINERACT-1502) To support Webhooks with all paths instead of only absolute path

     [ https://issues.apache.org/jira/browse/FINERACT-1502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandeep resolved FINERACT-1502.
-------------------------------
    Resolution: Fixed

*Root Cause :* This problem is happening due to retrofit2 library as it removes relative path from baseURL due to "/" present in request like Get("/") , POST("/") etc. So it updates [http://www.hostname.com/v1/api/webhook] to [http://www.hostname.com/] while making API call and hence we get 404 error.

Please refer attached screenshots for same where i printed baseURL in logs, So baseURL was updated during api call and hence it is resulting in 404 error

*Resolution* :
So in order to support absolute url as well as all other relative URL Paths, I updated Webhook Service Code and replaced GET("/") by GET(".") So that retrofit2 library does not remove anything from baseURL. I tested code and it is working fine with both kind of URLs.

> To support Webhooks with all paths instead of only absolute path
> ----------------------------------------------------------------
>
>                 Key: FINERACT-1502
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1502
>             Project: Apache Fineract
>          Issue Type: Bug
>            Reporter: Sandeep
>            Priority: Major
>         Attachments: WebhookAPICallUpdatesURL.png
>
>
> Current Implementation supports Webhook URL with absolute path like [https://www.hostname.com|https://www.hostname.com/] but it does not support urls like [https://www.hostname.com/v1/api/webhook/] or [https://www.hostname.com/webhook/]
> *Currently Webhook URLs working* : Only AbsoluteUrls as baseURL ([http://www.hostname.com/])
> *URLs Not working* : Relative Paths in baseURL like [http://www.hostname.com/v1/api/webhook]
> *Root Cause :* This problem is happening due to retrofit2 library as it removes relative path from baseURL due to "/" present in request like Get("/") , POST("/") etc. So it updates [http://www.hostname.com/v1/api/webhook] to [http://www.hostname.com/] while making API call and hence we get 404 error.
> Please refer attached screenshots for same where i printed baseURL in logs, So baseURL was updated during api call and hence it is resulting in 404 error
> *Resolution* :
> So in order to support absolute url as well as all other relative URL Paths, I updated Webhook Service Code and replaced GET("/") by GET(".") So that retrofit2 library does not remove anything from baseURL. I tested code and it is working fine with both kind of URLs.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)