Page 1 of 1

RequestUrl from Report Designer not using HTTPS protocol

Posted: Wed Oct 02, 2024 7:19 pm
by christianmurata
Hello, our team is using the stimulsoft-designer-angular component for online report editing.

We're using the component as follows in our Angular app [stimulsoft-designer-angular.png].

These are the versions used:
stimulsoft-designer-angular@2024.3.5
Stimulsoft.Reports.Angular.NetCore@2024.3.5

The component's requestUrl is set to https:// but at a certain point requests are made without the https protocol.

What can I do to ensure that the https protocol is used?

I've attached images of the component definition and the errors.

Re: RequestUrl from Report Designer not using HTTPS protocol

Posted: Thu Oct 03, 2024 10:13 am
by Vadim
Hello

It seems that you configured RouteTemplate in options, please check it
StiAngularDesignerOptions options.Server.RouteTemplate

Re: RequestUrl from Report Designer not using HTTPS protocol

Posted: Thu Oct 03, 2024 11:33 am
by christianmurata
Hello!

I haven't used this option on my API. This is how I configure the designer to display a blank report.

Code: Select all

[Route("api/[controller]")]
public class DesignerController : Controller
{        
    [HttpGet]
    public IActionResult Get(string lang, string data)
    {
        var requestParams = StiAngularDesigner.GetRequestParams(this);
        if (requestParams.Action == StiAction.Undefined)
        {
            var options = new StiAngularDesignerOptions();
            options.Height = Unit.Percentage(100);
            options.Dictionary.PermissionDataConnections = StiDesignerPermissions.None;
            options.Dictionary.PermissionDataSources = StiDesignerPermissions.View;
            options.Dictionary.PermissionDataRelations = StiDesignerPermissions.View;
            options.Appearance.Zoom = StiZoomMode.PageWidth;

            options.Localization = lang switch
            {
                "es" => "Localization/es.xml",
                "en" => "Localization/en.xml",
                _ => "Localization/pt-BR.xml"
            };
            return StiAngularDesigner.DesignerDataResult(requestParams, options);
        }
        return StiAngularDesigner.ProcessRequestResult(this);
    }

    [HttpPost]
    public async Task<IActionResult> Post()
    {
        var requestParams = StiAngularDesigner.GetRequestParams(this);
        if (requestParams.ComponentType == StiComponentType.Designer)
            switch (requestParams.Action)
            {
                case StiAction.GetReport: return await GetReport();
                //case StiAction.SaveReport: return await SaveReport(identifier, reqData);
            }
        return StiAngularDesigner.ProcessRequestResult(this);
    }

    public async Task<IActionResult> GetReport()
    {
        var report = StiReport.CreateNewReport();
        return StiAngularDesigner.GetReportResult(this, report);
    }
}

Re: RequestUrl from Report Designer not using HTTPS protocol

Posted: Thu Oct 03, 2024 1:13 pm
by christianmurata
Hello,

I added the following code to the Get() method.

Code: Select all

this.HttpContext.Request.Scheme = "https";
I also ensured that options.Server.RouteTemplate is null.

Code: Select all

options.Server.RouteTemplate = null;
This worked for me.

Re: RequestUrl from Report Designer not using HTTPS protocol

Posted: Thu Oct 03, 2024 10:30 pm
by Lech Kulikowski
Hello,

Thank you for the information.