This request has been blocked because sensitive information could be disclosed to third party

This request has been blocked because sensitive information could be disclosed to third party

dpanscikdpanscik Posts: 202Questions: 47Answers: 0

I am certainly getting some technical issues on this build out of editor that I have never seen before.

Anyone see this one where GET is blocked?

I have a browser network response as follows;

This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.

Here is my controller

` public class AlternativeBillingController : Controller
{
[Route("AlternativeBilling/DataTransport")]
[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)]
public ActionResult DataTransport()
{
DefaultConnection1 dbConnection2 = new DefaultConnection1();

        //var request = HttpContext.Current.Request;
        var request = System.Web.HttpContext.Current.Request.Form;

        var settings = Properties.Settings.Default;


        using (var db = new Database(settings.DbType, settings.DbConnection))
        {

            var response = new Editor(db, "GR_AlternativeBilling", "TableID")
                .Model<GR_AlternativeBilling>()
                .Process(request)
                .Data();

            return Json(response);
        }
    }
}`

To tell JSON a GET is ok, When i change return Json(response); to return Json(response, JsonRequestBehavior.AllowGet);

I get this error.

! "draw": null,
"data": [],
"recordsTotal": null,
"recordsFiltered": null,
"error": "Method not found: \u0027System.String[] System.String.Split(Char, System.StringSplitOptions)\u0027.",
"fieldErrors": [],
"id": null,
"meta": {},
"options": {},
"searchBuilder": {
"options": {}
},
"searchPanes": {
"options": {}
},
"files": {},
"upload": {
"id": null
},
"debug": null,
"cancelled": []

Answers

  • kthorngrenkthorngren Posts: 21,374Questions: 26Answers: 4,957

    A google search of the error has this SO thread on top. Hope it helps resolve your issue as I'm not familiar with ASP.NET MVC.

    Kevin

  • kthorngrenkthorngren Posts: 21,374Questions: 26Answers: 4,957

    Looks like changing the JSON response to this should work:

    return Json(response, JsonRequestBehavior.AllowGet);
    

    Kevin

  • dpanscikdpanscik Posts: 202Questions: 47Answers: 0

    Hi Kevin,

    When I do your suggestion, I get the following error. This error is also discussed in my original post.

    ! "draw": null,
    "data": [],
    "recordsTotal": null,
    "recordsFiltered": null,
    "error": "Method not found: \u0027System.String[] System.String.Split(Char, System.StringSplitOptions)\u0027.",
    "fieldErrors": [],
    "id": null,
    "meta": {},
    "options": {},
    "searchBuilder": {
    "options": {}
    },
    "searchPanes": {
    "options": {}
    },
    "files": {},
    "upload": {
    "id": null
    },
    "debug": null,
    "cancelled": []

  • kthorngrenkthorngren Posts: 21,374Questions: 26Answers: 4,957

    Method not found: System.String[] System.String.Split(Char, System.StringSplitOptions)

    Possible this thread will help?

    Kevin

  • dpanscikdpanscik Posts: 202Questions: 47Answers: 0

    I copied the dll that arrives with the editor builder download into the bin folder of the project replacing the dll that arrives via nuget.

    Still have the same error message.

  • allanallan Posts: 63,572Questions: 1Answers: 10,482 Site admin

    You are presumably using .NET Framework? What version specifically?

    If you add .TryCatch(false) immediately before the .Process(...) call, does it give any additional information in the error that is thrown?

    Allan

  • dpanscikdpanscik Posts: 202Questions: 47Answers: 0

    Hi Allan,

    I am using .NET 4.8

    Adding in .TryCatch(false results in the same error. The difference being with adding in .TryCatch(false the error appears in Visual Studio where without .TryCatch(false the error appears in the browser.

    Here is the error I am seeing.

    EXCEPTION

    • $exception {"Method not found: 'System.String[] System.String.Split(Char, System.StringSplitOptions)'."} System.MissingMethodException
  • dpanscikdpanscik Posts: 202Questions: 47Answers: 0

    I figured out a fix here. I hadn't realized when copying DLLs into VisualStudio project folder (replacing old DLLs) you had to then go into Visual Studio and unregister the old DLL, then re register the new DLL.

    I am now using the most recent DLL that is packaged with editor-generator. This DLL has a file creation date of 6/22/2024. The DLL that was previously not working had a file creation date of 2-28-2023 4:11 AM

  • allanallan Posts: 63,572Questions: 1Answers: 10,482 Site admin

    Interesting. Many thanks for letting us know and great to hear that you've got it working now!

    Allan

Sign In or Register to comment.