Haiku Problem with URL authentication passthrough

scantrel

Member
I'm trying to send a web-based command along with a username/password in the URL and it's not working. The format I'm trying to use is:
 
h ttp://MyHouse:[email protected]/api/controller.unitWithNumber(42).on()
 
(Note, I added the extra space between the H and TTP so it would print out the full text and not make it a working link)
 
IE tells me that the spelling is wrong, and Chrome tells me it couldn't find that term and do I want to search on something else.
 
Not sure how to proceed...
 
Ugh, ok that's a typo from the fact that I can't cut and paste into the forums and have to retype by hand...
 
But is the general syntax correct? Could I see an example?
 
The port number goes after the dub dub dub...note that the XX is TT here..
 
hXXp://192.168.0.12:9399/api/controller.unitWithNumber(42).on()
 
Thanks Pete...I am going to pay the price for mistyping a hand-entered entry here, because it looks like I didn't try the command with the port number. Let me retype exactly what I am trying that isn't working...
 
hxxp://myhouse:[email protected]:9399/api/controller.unitWithNumber(42).on()
 
I have http and not hxxp of course in the one I'm using in the browser.
 
Yeah here do similiar with other automation software but do not own Haiku such that I cannot help you with the syntax.
 
You can if you want enable debug logging on Haiku, open one window up with the browser and another looking at the debug concurrently such that you can see if there is a syntax error in your html command line stuff when you type it.
 
The browser behavior reported in the initial post is bizarre. I would bypass the browsers completely and use cURL instead to issue the request from the command line. Here's a Q&A about how to install it on Windows: http://stackoverflow.com/questions/9507353/how-do-i-install-set-up-and-use-curl-on-a-windows
 
If I try it here with the URL in the question there's no machine at that address so I get:
 

curl: (7) Failed to connect to 192.168.0.12 port 9399: No route to host 
 
Or with the -D option, if I purposely point it to a machine that I know is going to raise a 404, I can see the headers of the response from the server:
 


$ curl -D - 'http://.../api/controller.unitWithNumber(42).on()'
HTTP/1.0 404 Not Found
Server: httpd
Date: Fri, 24 Jul 2015 16:50:57 GMT
Content-Type: text/html
Connection: close


<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD>
<BODY BGCOLOR="#cc9999"><H4>404 Not Found</H4>
File not found.
</BODY></HTML>

 

 
 
Many browsers now block the embedding of the username/password in the URL to avoid URL spoofing via the username prefix. Using something like CURL should work much better.
 
pete_c said:
Curious what was the issue?
 
I wish I could tell you. I went back and checked the Script API documentation and copied/pasted it from the PDF to Wordpad then edited the example values to use the proper username, password and IP. It didn't look different to me than the first time I had tried, but clearly something was different. 
 
Back
Top