RequestEncoding settings on azure function app

I have an Azure function app with a common trigger signature like this public static async Task<IActionResult> RunAsync( [HttpTrigger(AuthorizationLevel.Function, “post”, Route = null)] HttpRequest req, ILogger log) The request body “req.Body” doesn’t have utf-8 encoding. For this particular application I need this specific encoding. How do I achieve this, I am using the azure function … Read more

Setting the compiler path on Windows

In my computer c_cpp_properties.json file looks like this, { “configurations”: [ { “name”: “Win32”, “includePath”: [ “${workspaceFolder}/**” ], “defines”: [ “_DEBUG”, “UNICODE”, “_UNICODE” ], “compilerPath”: “C:\\MinGW\\bin\\gcc.exe”, “cStandard”: “c11”, “cppStandard”: “c++17”, “intelliSenseMode”: “clang-x64” } ], “version”: 4 } Is the compilerPath and intelliSenseMode are correct ? or compilerPath should be something like this C:\MinGW\lib\gcc\mingw32\6.3.0\include\c++ or C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/g++.exe”, … Read more

LibGit2Sharp-ssh. Unable to load shared library ‘git2-ssh-baa87df’

I’m using LibGit2Sharp-ssh library for clone repository. string repositoryUrl = “ssh://[email protected]/project-name/repo-name.git”; LibGit2Sharp.Repository.Clone(repositoryUrl, localPath, new LibGit2Sharp.CloneOptions { CredentialsProvider = MyCredentialsProvider }); private Credentials MyCredentialsProvider(string url, string usernameFromUrl, SupportedCredentialTypes types) { var sshDir = Directory.GetCurrentDirectory(); return new LibGit2Sharp.SshUserKeyCredentials() { Username = usernameFromUrl, Passphrase = string.Empty, PublicKey = Path.Combine(sshDir, “id_rsa.pub”), PrivateKey = Path.Combine(sshDir, “private_key.pem”), }; } But getting … Read more

Roslyn generated dll can’t be referenced

I’m trying to generate a .dll with Roslyns Emit-Api, which works, and references this .dll in another project, which fails. What I’ve done so far: This is how the dll is generated static void compileToDll() { string codeDll = @” using System; public class MyClass { public static void RunIt(FEE_BoolSlot slot) { Console.WriteLine(“”Hello World!””); } … Read more

How do I take values from query parameter of `listener` component and apply it to query parameter of `request` component in Mulesoft Anypoint Studio?

I have an API endpoint that I can send GET request to using in Anypoint Request component. It has start_date and end_date as query parameter. I also have a Listener component that is serving the API using the same query parameters. When I hardcode the values to the query parameters of my Request component but … Read more

How to stop large file upload on NextJs

I’m writing an app in NextJs that has a form that uploads an image. Image file size should be limited, so of course there is code that in client side limits file size, but as you know those limitations could be easily skipped. So I want to limit file size upload also on server side. … Read more

Paypal webhook PAYMENT.CAPTURE.COMPLETED not sent immediatly

I setup Paypal billing in my backend .(I avoided to do integration in the android client because google prevent thirdparty payment), 1- the client only register a record in my server 2- i setup a trigger to make an order an to generate a new orderId 3- status : PAYER_ACTION_REQUIRED, and the user have to … Read more

Mockito – doThrow (or thenThrow) with Exception constructed with passed argument

I’d like to check an input, and then throw an exception based on that input.\ Maybe something simple like this: when(myRepository.findById(any())) .thenThrow(new MyException(getArguments()[0]); Is something like this not possible? If not, is there an alternative? You can achieve this behavior with a thenAnswer call: when(myRepository.findById(any())).thenAnswer(invocationOnMock -> { throw new MyException(invocationOnMock.getArgument(0, String.class)); });