sandeepsoni911 opened a new pull request #2034:
URL: https://github.com/apache/fineract/pull/2034


   Updated WebhookService to support all paths instead of only absolute path. 
   
   ## Description
   
   Current Implementation supports Webhook URL with absolute path like 
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.
   
   
   **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.
   
   Ignore if these details are present on the associated [Apache Fineract JIRA 
ticket](https://github.com/apache/fineract/pull/1284).
   
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request 
- thanks!
   
   - [x] Write the commit message as per 
https://github.com/apache/fineract/#pull-requests
   
   - [x] Acknowledge that we will not review PRs that are not passing the build 
_("green")_ - it is your responsibility to get a proposed PR to pass the build, 
not primarily the project's maintainers.
   
   - [x] Create/update unit or integration tests for verifying the changes made.
   
   - [x] Follow coding conventions at 
https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
   
   - [x] Add required Swagger annotation and update API documentation at 
fineract-provider/src/main/resources/static/api-docs/apiLive.htm with details 
of any API changes
   
   - [x] Submission is not a "code dump".  (Large changes can be made "in 
repository" via a branch.  Ask on the developer mailing list for guidance, if 
required.)
   
   FYI our guidelines for code reviews are at 
https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to