<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>> schrieb am Mo., 24. Juni 2019, 09:30:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Sun, 23 Jun 2019, Sven Barth via fpc-pascal wrote:<br>
<br>
>>>>> - localhost:8080/metadata works<br>
>>>>> - localhost:8080/users returns "INVALID RESOURCE"<br>
>>>><br>
>>>> Because it has rdoConnectionInURL set, and so you must do<br>
>>>> localhost:8080/expenses/users<br>
>>><br>
>>> Ahhhhhh! Hadn't seen that this option is active... Okay, then it <br>
>>> indeed works as expected, both with and without rdoConnectionInURL.<br>
>>><br>
>>> By the way: I noticed a slight annoyance, but I don't know whether <br>
>>> one can really do something about that: When I set rdoConnectionInURL <br>
>>> to False inside the object inspector it turns on again, because <br>
>>> rdoConnectionResource is set. Took me a moment to look at the source <br>
>>> code to see that I need to disable rdoConnectionResource first. Don't <br>
>>> know what a better solution would be...<br>
>><br>
>> Funny you mention this, I was fooled myself yesterday, I also had to <br>
>> look in<br>
>> the sources :(<br>
>><br>
>> One way would be to disable rdoConnectionResource if you disable<br>
>> rdoConnectionInURL. I will add this.<br>
><br>
> But wouldn't that lead to an analogous problem with <br>
> rdoConnectionResource if rdoConnectionInURL is not set?<br>
<br>
I fixed this: if you disable rdoConnectionInURL, rdoConnectionResource is<br>
disabled. If not, if rdoConnectionResource is included, rdoConnectionInURL<br>
will be set too.<br>
<br>
I also fixed the use in a module. The module will set 'active' to false on<br>
the dispatcher. Before handling the request, it takes the request and uses<br>
pathinfo to set the routing parameters<br>
<br>
With the sample module, I tested all possible cases:<br>
<br>
No rdoConnectionInURL:<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/metadata" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/metadata</a> --content-on-error -O - -d --auth-no-challenge<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/users" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/users</a> --content-on-error -O - -d --auth-no-challenge<br>
<br>
rdoConnectionInURL set:<br>
Basepath empty:<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/metadata" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/metadata</a> --content-on-error -O - -d --auth-no-challenge<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/expenses/metadata" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/expenses/metadata</a> --content-on-error -O - -d --auth-no-challenge<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/expenses/users" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/expenses/users</a> --content-on-error -O - -d --auth-no-challenge<br>
<br>
BasePath set to Lola<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/Lola/metadata" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/Lola/metadata</a> --content-on-error -O - -d --auth-no-challenge<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/Lola/expenses/metadata" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/Lola/expenses/metadata</a> --content-on-error -O - -d --auth-no-challenge<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/Lola/expenses/users" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/Lola/expenses/users</a> --content-on-error -O - -d --auth-no-challenge<br>
<br>
BasePath set to Lola/Pola<br>
<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/Lola/Pola/metadata" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/Lola/Pola/metadata</a> --content-on-error -O - -d --auth-no-challenge<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/Lola/Pola/expenses/metadata" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/Lola/Pola/expenses/metadata</a> --content-on-error -O - -d --auth-no-challenge<br>
wget --auth-no-challenge --http-user=me --http-password=secret <a href="http://localhost:8080/REST/Lola/Pola/expenses/users" rel="noreferrer noreferrer" target="_blank">http://localhost:8080/REST/Lola/Pola/expenses/users</a> --content-on-error -O - -d --auth-no-challenge<br>
<br>
<br>
I think I covered all cases. If I forgot one, do let me know...<br>
<br>
I will update the Wiki.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Awesome! Thank you! Though I don't know when I'll be able to test it next. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>