Wrong REST API endpoint/url generation

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
sabaria
Posts: 4
Joined: Thu Aug 12, 2021 3:51 am

Wrong REST API endpoint/url generation

Post by sabaria » Thu Aug 12, 2021 5:10 am

Hi Team

We are using the DocuVieware July 2021 version for the ASP.NET framework 4.8 MVC views.

It is hosted within the Azure app service container. The HTTPS/SSL is terminated at the Azure side.

The problem is DocuVieware is internally generating the REST path dvapi3/docuvieware3api Url.

1.It is accessed via the HTTP protocol instead of the HTTPS protocol.
Wrong Url http://XXXXxx.azurewebsites.net/dvapi3/ ... erequest/1
Correct Url https://XXXXxx.azurewebsites.net/dvapi3/docuvieware3api/baserequest/1
2. The same application is accessed by multiple domains names (hostnames). These names are accessible via the X-Forwarded-Host header

So the document viewer API calls are blocked by the browsers and the document never loads in the browser.

Possible solution. While generating the URL please honor the X-Forwarded-Proto and X-Forwarded-Host headers while generating the URLs

Is there any workaround already exists for this issue?

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Wrong REST API endpoint/url generation

Post by Fabio » Fri Aug 13, 2021 5:19 pm

Hello Sabaria,

It seems your code takes the relative URL instead of the absolute one.
Can you try to override the application URI? It should force the protocol and will provide the absolute URL to your app.

ApplicationUri parameter -> https://www.docuvieware.com/guides/aspn ... ring).html

Tell me if it corrects the issue or if I misunderstood it.

With best,
Fabio

sabaria
Posts: 4
Joined: Thu Aug 12, 2021 3:51 am

Re: Wrong REST API endpoint/url generation

Post by sabaria » Fri Aug 20, 2021 7:42 am

Hi Fabio
Thanks for the response.

As I mentioned, the application is a multi-tenant application with multiple subdomains are set up for the same application.
For example, the users can access the application via https://XXXXxx.azurewebsites.net/ https://YYyy.azurewebsites.net/ and https://ZZzz.azurewebsites.net/, etc.

I cannot use the ApplicationUri parameter which is common for every request.

Can you please help me to set up this relative URL for each request when generating the client-side HTML? Or please honor the X-Forwarded-Proto and X-Forwarded-Host headers while generating the URLs which are HTTP industry standards.

Please consider this as high priority issue...

sabaria
Posts: 4
Joined: Thu Aug 12, 2021 3:51 am

Re: Wrong REST API endpoint/url generation

Post by sabaria » Thu Aug 26, 2021 5:47 pm

Anyone, could you please help us resolve this issue?

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Wrong REST API endpoint/url generation

Post by Fabio » Fri Sep 03, 2021 2:15 pm

Hello,

Sorry for the late.
You need to set the load-balancer address as the absolute URL to let it dispatch the requests by itself.

With best,
Fabio

sabaria
Posts: 4
Joined: Thu Aug 12, 2021 3:51 am

Re: Wrong REST API endpoint/url generation

Post by sabaria » Fri Sep 03, 2021 3:48 pm

Hi As I mentioned I cannot use an absolute URL that will accept only one value where my application is having multiple domains configured in the load balancer. So it has to change for each request.

rizaref
Posts: 1
Joined: Sun Oct 03, 2021 5:14 pm

Re: Wrong REST API endpoint/url generation

Post by rizaref » Sun Oct 03, 2021 5:19 pm

Anyone, could you please help us resolve this issue?
https://itkoding.com/cara-membuat-halaman-di-microsoft-word/
Last edited by rizaref on Wed Oct 06, 2021 4:11 am, edited 1 time in total.

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Wrong REST API endpoint/url generation

Post by Fabio » Tue Oct 05, 2021 9:58 am

Hello,

The conversation had continued on our helpdesk and a ticket has been created on our side to implement a way to deal with such usage.
I'll keep you posted about any updates on this conversation.

With best,
Fabio

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest