asp.net core 2.1 preview 2 - signalR CORS issues and 405 on OPTIONS request - asp.net-core-signalr

Using the latest versions of signalR and #aspnet/signalr I still get issues connecting. I'm fairly sure the versions are exactly the same.
I've been following the startup project here. But instead I'm using an Angular 5 application. I get issues with CORS headers and more specifically the OPTIONS request returns a 405 method not allowed.
Visual studio version here.
Typescript/javascript client version here

I faced same issue and it appeared that order matters. Make sure you've put it like this:
app.UseCors(...builder...)
app.UseSignalR(...routes...)
app.UseMvc(...routes...)

Related

Null value returned from Furl using Xamarin.Forms, request works in Postmaster

I originally posted this on GitHub but the plugin author asked me to move it to Stack Overflow.
I'm developing a Xamarin.Forms app. I'm trying do get data from a test API I've setup with OAuth authorisation. I can get the data fine from Postmaster, but always get a null when doing the same query from Furl.
Using Flurl 2.7.1 (latest stable from NuGet) and Flurl.Http 2.3.1 (latest stable from NuGet).
The code is below (it's a test site and token, so I don't mind posting the link and token as they'll be deleted soon).
I know it's authorising ok, because if I change the token I get a 401 (which was also happening originally until I removed 'Bearer' from the beginning of the token).
I'm testing from Visual Studio 2017 Android Emulator. HttpClientImplementation has been set to Android, and SSL/TLS implementation is Native TLS 1.2+.
var list = await "https://cloud.squidex.io/api/content/straktest/experiment?"
.WithOAuthBearerToken("eyJhbGciOiJSUzI1NiIsImtpZCI6IjkxRkRENEVCRDYwNjMxNURFREI4MENEMDkzMERFRkZBMjFEREE2NkIiLCJ0eXAiOiJKV1QiLCJ4NXQiOiJrZjNVNjlZR01WM3R1QXpRa3czdi1pSGRwbXMifQ.eyJuYmYiOjE1MjY0MTI2NTksImV4cCI6MTUyOTAwNDY1OSwiaXNzIjoiaHR0cHM6Ly9jbG91ZC5zcXVpZGV4LmlvL2lkZW50aXR5LXNlcnZlciIsImF1ZCI6WyJodHRwczovL2Nsb3VkLnNxdWlkZXguaW8vaWRlbnRpdHktc2VydmVyL3Jlc291cmNlcyIsInNxdWlkZXgtYXBpIl0sImNsaWVudF9pZCI6InN0cmFrdGVzdDp0ZXN0Y2xpZW50Iiwic2NvcGUiOlsic3F1aWRleC1hcGkiXX0.ELkBz-vg_gTnGJ9ODXXE5c1AMeYqPmYKxgfgovir6QTxLPRvKNkGeYbzXC6KjGQ4nUdIFzxxjX8_CPVg5MixgHRqzcBSPjLktbCjhkvXMOkSiUNoqnk8uSXmwm_QNZ1XgWZy3d3DPDdMMjliNh0oRbhipwJc9XkqgNFZKylk3-ijCkocbfCLkSH_z2Nt0ikWvL4Ge2zc4udTfsfs2xR4x1hWlFC-iUucw0Vz1LhUAZjRIc0pXPNQvQdTi9bppZ_chUNaJvEY40dcTd-850Z7TQBgN7utrTLbnWnETzWjL4D_KNWDNEfKknJm-4ir08TevfoL08Vd4DmdCjbeJKR8tg")
.GetAsync();
//also tried with .GetStringAsync();//.GetJsonListAsync();
Am I doing something wrong?
Thanks,
Strak

Kentico V8.2 to V9.0 upgrade missing ~/CMSPages/GetResource.ashx

I'm recently going through my first Kentico upgrade on a site that was previously handed to me from somebody else. There were some hinks initially, but I have to say the V8.2 to V9.0 upgrade is gone off with a degree of success. There is one last issue I'm tackling. Initially the issue was with images stored in the database, but I resolved that with setting custom URL extensions. The style sheet we have in the database is returning a 404, so the entire site is without style.
I did some digging, and found the following:
While we were using ~/CMSPages/GetCSS.aspx in V8.2, that appears to have been deprecated/obsolete for some time now. The CSS references in the master page all point to ~/CMSPages/GetCSS.aspx.
In V8.2, I can confirm the presence of ~/CMSPages/GetResource.ashx, but that appears to be missing after the V9.0 upgrade. I installed a blank template site as well to confirm, and it's not there either. I verified I am using the latest upgrade package. I had already hit an issue with the pre-12/15 edition.
The V8.2 ~/CMSPages/GetResource.ashx does not work in a V9.0 as the API for CMS.UIControls no longer contains the ResourceHandler class (which is also used in ~/CMSPages/GetCSS.aspx).
I can confirm in the V8.2 codebase that ~/CMSPages/GetResource.ashx works, returning the specified stylesheet.
TL;DR - Upgrading from V8.2 to V9.0, I appear to be missing ~/CMSPages/GetResource.ashx, and am not sure where it got off to.
Environment Information
Test Server: Windows Server 2008R2 SP1 on IIS 7.5 w/ .NET 4.5.2, MSSQL 2008R2 Database backend
Dev Server: Windows 8.1 with IIS 8.5, VS 2015 and MSSQL 2008R2
Kentico V8.2 Site in Portal Mode
I appreciate any ideas you have.
Thanks!
Most of the .ashx were moved to the CMS.UIControls assembly and adjusted to implement IHttpHandler.
This way the handlers can be used by any application that references the Kentico libraries, specifically the UIControls. This approach has been utilized e.g. in the new MVC support in Kentico 9.
If you need to customize the handlers you can take advantage of the GetFileHandler and AdvancedGetFileHandler abstract classes implementing IHttpHandler.
I was receiving a 404 on GetResource.ashx in v8 when deploying my site. I have my site setup as a web application. My problem was I was only deploying CMSApp using Visual Studio. I needed to also deploy CMSApp_AppCode. https://docs.kentico.com/display/K81/Publishing+web+application+projects+from+Visual+Studio
when I upgraded to v9 from v8.2 I was getting a 500 Error on GetResource.ashx. After my upgrade I just re-deployed. I don't know what the issue was, but getting the errors, I cleared out all the files on the Azure server then deployed. This fixed my error.
Maybe one of these two items will help you.
If I read the release notes correctly, they moved the files to the UIControls library and you can still utilize the old references without issue. I've upgraded my website from 8.0.48 to 9.0.1 and 9.0.4 and had no issues. In fact, I still use the /CMSPages/GetResource.ashx?scriptfile=/path/to/file.js I believe the change was specifically to accommodate the MVC model.

Swagger 1.3.7 and Jersey 2.15/2.16 issue: the request entity is in a format not supported by the requested resource

I have a REST API that was working with Jersey 2.6 and Swagger 1.3.7. I read that Jersey 2.9 fixes a warning that I was getting so I upgraded to the latest Jersey 2.16 but then Swagger stopped working. I went back and upgraded one version at a time until I saw that Swagger was working with 2.15 so I settled on that. Now, the PUT API fails with Swagger with the following error:
The server refused this request because the request entity is in a format not supported by the requested resource for the requested method
The API works using FireFox RESTClient and specifying "application/json".
I do have "jersey-media-json-jackson" as a dependency and call "Client client = ClientBuilder.newClient().register(JacksonFeature.class);" in the program.
I tried upgrading Swagger but that did not help.
Has Swagger been verified to work with Jersey 2.15/2.16?
I've recently managed to get swagger-core to work with Jersey 2.16 with a similar issue. Keep in mind they are using the latest version (1.5.X) and not 1.3.X but the same solution will apply.
The problem is most likely with version resolution, specifically, the one of jackson-databind. For some reason, even jersey-media-json-jackson 2.16 depends on an older version of jackson-databind, even though it works fine with the latest version. Without having more details, it would be difficult to suggest a full solution, but you can follow the dependency tree and see the conflicts there.
If you do require further assistance, I'd suggest either using our mailing list, or even better, the IRC channel where we could interact online and resolve it.

Mule IDE plugin for Eclipse url not working (http://dist.muleforge.org/mule-ide/updates-2.1.x/)

Mule id plugin Url is not working. Can any one help to get an alternate url for the same plugin.
http://dist.muleforge.org/mule-ide/updates-2.1.x/
This url is also mentioned in the below tutorial.
http://www.mulesoft.org/documentation-3.2/display/32X/Installing+Mule+ESB+3+and+the+Mule+IDE
Below is the error which i am receiving after accessing this url in browser.
Network Error (tcp_error)
A communication error occurred: "Connection refused"
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
For assistance, contact your network support team.
Mule version 2X uses the url :- http://dist.muleforge.org/mule-ide/updates-2.1.x/ and for Mule version 3X the url :- http://www.mulesoft.org/documentation-3.2/display/32X/Installing+Mule+ESB+3+and+the+Mule+IDE is being used.
You need to check the version of Mule you are using and need to use the url that matches your Mule version.
If you are using Mule Enterprise edition you can take support from the MuleSoft Support, else if you are not using Enterprise you can post the issue in their forum
I seriously doubt there is still support for the Mule IDE, it was deprecated in favour of Mule Studio (that then became Anypoint Studio).
Do you really need to do a new development on Mule 2.x? If not, please consider using the much better Anypoint studio. If you need to stick to the 2.x version, you could just use a vanilla version of eclipse that will take care of the the autocompletion and then export to the apps directory of a running mule container for a hot deployment.

How OrientDB Studio Code Works?

I have a question regarding the way the OrientDB studio works.
When I build my own web application to access the OrientDB database, I need to enable CORS and then it works, but how comes that the OrientDB studio app works without having to enable CORS?
That's really puzzling me because I'd like to reuse the code logic of the OrientDB Studio app in my own application and it does not work like the OrientDB Studio app.
Also, it seems that the OrientDB Studio app is using the REST API of OrientDB, not the JavaScript API (orientdb-api.js). Am I right?
Is there any documentation I could read to get a full understanding of how the Studio works?
Regards,
Jeremie
You need to enable CORS because your app it is outside the domain of ODB. if you are running it in localhost is http://localhost:2480.
So if you make a request from a different domain the browser stops you if the server has CORS disabled.
Studio starts as a plugin inside ODB http (http://localhost:2480/studio/index.html) so is allowed to do request without enabling CORS.
If you do not want to enable CORS you can put your html and js under the www directory in
the $ORIENTDB_HOME distribution.
There is no documentation about Studio Code. You can browse it here https://github.com/orientechnologies/orientdb-studio if you need some further information you can ask me as i'm the main maintainer of Studio :D
I can tell you that it does not use the orientdb-api.js as it uses angular.js.
I advice you to not use orientdb-api.js but uses directly the REST api
with JQuery/Angular.