Not accessible https url using pac file - pac

I am trying to access on of my https url using pac file but it's not working.
I am using below the code in pac file.
if(shExpMatch(url,"https://myapplication.uat.com"))
return "Direct";

Related

Apple's apple-app-site-association file on S3 with CloudFront Distribution

I am trying to serve apple-app-site-association from the S3 via CloudFront distribution via my custom domain.
But when I am given a path like below, It's started downloading rather than showing in the browser.
https:/mycustomdonain.com/.well-known/apple-app-site-association
Do I need to make any setting at S3 or CloudFront level to make it work?
Note: The application is developed in Angular.
Thanks
As Christos says, you need to set the content-type response header in S3, which then also applies to Cloudfront HTTPS URLs.
Here is an example of mine, that I use for deep linking and OpenID Connect with an HTTPS redirect URI:
https://mobile.authsamples.com/.well-known/apple-app-site-association
Further details on how this looks in my blog post, where you set the content type by editing tte file properties:

Saving file in mac using spring boot

I m developing web-service using spring boot. I have two API. In first Api I a allowing user to upload the file. I m saving the file in my system (Mac). Where should I store those file (any specific folder/directory) so that I can return an url and client (iOS) later can access that file using that url.
You can store all the files in a local directory and you can run a simple http server locally serving on any port .
You can access the file in client side simply using local url(localhost:port/filename).The whole setup has to be local
But the best way to do this is to store the file in s3 bucket or any other cdn(ex-uploadcare)
which can be shared using simple url

WOPI Host implementation, trying to render doc in iframe

I'm trying to get Wopi host implementation in Ruby on Rails application.
My domain is whitelisted under CSPP. Trying to get the file contents in iframe, but I just see "Word Online" and a loading gif, I return binary file contents of docx as response to ..wopi/files/:id/contents. I don't get any calls hitting my host server.
Sample wopi_src_url: https://word-view.officeapps-df.live.com/wv/wordviewerframe.aspx?ui=1033&rs=1033&dchat=false&IsLicensedUser=0&WOPISrc=https://sgdevwopi.test-wopi.sycamoreinformatics.com/wopi/files/31/contents?access_token=eyJhbGciOiJIUzI1NiJ9.eyJ1c2&access_token_ttl=160000000
Able to get the Wopi validation page in Iframe using .wopitest file. How should I proceed further? Or what am I missing? Please help.
Note: I'm using ngrok to make my local app server visible publicly with whitelisted domain.
I see to problems with your URL. You must ensure that
the URL is of the form http://server/<...>/wopi/files/(file_id) (so drop the /contents part - WOPI client will call the /contents endpoint automatically when necessary)
the WOPISrc parameter value is encoded to a URL-safe string
More info here and here.

draw.io: cannot open xml file from URL (using the parameter "url=...." )

I've installed draw.io on a local web server and want to open a xml file which resides on the same web server.
The documentation proposes the URL parameter url=url
This is my xml file:
https://draw.io.myorg/folder/test.xml
https%3A%2F%2Fdraw.io.myorg%2Ffolder%2Ftest.xml (encoded)
This is the URL which uses the URL parameter url=...
https://draw.io.myorg/folder/draw.io-master/war/?url=https%3A%2F%2Fdraw.io.myorg%2Ffolder%2Ftest.xml
The above URL ends up with the message "file not found".
Same error if I try to open this URL via "Open->From URL".
When I store the xml into a local file, I can open it with "Open-> Device ..."
However, the web server and the browser show me a failure when opening this file:
https://mdraw.io.myorg/folder/draw.io-master/war/proxy?url=https%3A%2F%2Fdraw.io.myorg%2Ffolder%2Ftest.xml
Obviously the parameter url causes some redirection to a proxy which does not exist?
Any help is appreciated!

Error downloading file from a given URL

I am trying to download the given URL:
http://www.addic7ed.com/original/9521/7
but when i try to download the file using my Java Code:
URL url = new URL("http://www.addic7ed.com/original/9521/7");
ReadableByteChannel rbc = Channels.newChannel(url.openStream());
FileOutputStream fos = new FileOutputStream("abc.srt");
fos.getChannel().transferFrom(rbc, 0, 1 << 24);
The html page gets downloaded whereas the file to be downloaded should be a .srt extension file.
But when I try to download the above link using Internet Download Manager the file gets downloaded.
IDM converts the above given URL into http://www.addic7ed.com/srtcache/Supernatural/Supernatural%20-%2004x06%20-%20Yellow%20Fever.720p%20CTU.English.orig.Addic7ed.com.srt
So my question is how to achieve this in JAVA...?? Are there any API available to achieve this.
Have you looked at the HTML file? I suspect that it is actually an error page from the server, and that it contains clues about what is actually going on.
Here are some possibilities:
Maybe you need to supply authentication credentials.
Maybe the server is sending a redirect (3xx) response, and that the client side is not performing the redirect.
Maybe you need to set some extra headers to make the server realize that it should not turn the response as HTML. For example, an Accept header.
But note that the details will depend on the server that you are trying to talk to.
If I was trying to download files programmatically in Java, I would either use HttpUrlConnection or the Apache HttpClient libraries. Both will give you more control over the download process than simply using URL.openStream()
This is probably because the http response from http://www.addic7ed.com/original/9521/7 is a 302 redirect which your java code is not correctly handling. IDM correctly handles the redirect. A great tool to use if you are on a *nix based systme, or have cygwin installed on windows is curl.
curl -v http://myurl
will display all the http traffic information (request/response)
Have you tried with?
URL url = new URL("http://www.addic7ed.com/original/9521/7");

Resources