I have 2 computers running macOS 15.1.1 (24B91) and are generating a “loadurl( function url is malformed” error message. The same code works without error on earlier MacOS.
Thoughts?
I have 2 computers running macOS 15.1.1 (24B91) and are generating a “loadurl( function url is malformed” error message. The same code works without error on earlier MacOS.
Thoughts?
Any ideas where I can start to solve this? I have 2 employees who cant do any work until resolved. I know as a last resort we can roll back their computers os but that is a last resort because it will require a lot of set up and other applications would also need to rolled back so I would rather not have to do that.
Please and Thank you.
There’s nothing wrong with the loadurl( function in macOS 15.1.1. Here’s a screenshot showing that it works:
That error message means that you are passing an invalid URL to the function. For example:
So you need to review your code and see why it is passing a bad URL.
Hi Jim,
I only get the error on computers running the latest macOS. I can do the exact same action with the same code and it runs with out error on older os. Been running this code for several years with out issue. One caveat that might explain further, my url is to a text file with url/name.txt
Copy & Paste your code here. Indent it 4 spaces. Let a few more eyeballs have a look at it. Copy Paste a few lines of your text file as well.
This is it.
vRecord = loadurl("http://192.168.0.19/mdata/orders/7364-001.txt", 15, 1)
Been working for years.
That is a localhost address. It might have something to do with changes in security that came with the update.
It is the local network address for another mac running the web server. Another oddity is that on the same computers running macOS 15.1.1 that url will work in Safari but return the error in Panorama.
This does not produce a malformed URL error on my computer running macOS 15.1.1. Of course it doesn’t actually work because I can’t access your private network, but the error is “The request timed out”, which it should. However, if I add a % to the end of the URL then I get the malformed error.
Some background to provide context on how this works. The loadurl( function passes the text of the URL to an Apple API called URLString, which converts it from text into a special Apple data structure called NSURL. Then the NSURL structure is passed to an API called sendSynchronousRequest, which actually fetches the data over the internet. The malformed data error is reported if the URLString API is unable to convert the text into an NSURL. In other words, this error only involves the text of the URL itself - the code hasn’t even attempted to use the network yet.
I don’t know why you are having a problem with this URL. As I say, it is not malformed on my system. In any case, it’s the Apple URLString API that is having a problem - I have no visibility into how that API works internally, and if it does work differently in 15.1.1, there is nothing that I can do about it. I’m kind of doubting that it works differently, I think there is something else going on, perhaps an invisible character?
I understand your thinking on this theory, however, it seems unlikely to me because the malformed URL error is generated at a point in the code before it would even realize that it was a localhost address. Basically a malformed URL is one in which the characters in the URL are invalid - remember there are special rules about what characters can be in a URL and how to handle unusual characters with percent escaping. Malformed means the URL is bad on the character level.
Thank you Jim, I will keep digging.
FWIW,
I captured the url using displaydata and using Garys wonderful “Reveal Invisible Text” database showed no hidden characters. So the result from the code is a well formed url, unless the “-” character is causing a problem in macOS 15.1.1. Ill keep digging
Just to be clear, this character did not cause a problem when I tried it here on macOS 15.1.1.
Understood.