http plugin executing request twice?

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

http plugin executing request twice?

Postby swingman » Thu Nov 27, 2014 5:01 pm

Hi all,

this is an oddity on Servoy 7.4.x:
We want to post some data to a web service, using simple http authentication from a Servoy Smart client (Java 7, Windows):

This line of code
Code: Select all
response = poster.executeRequest("myusername","myverysecretpassword");

This works fine we get a 201 Created response which we are expecting.

But if we check the logs of the web service, we see a failed attempt
Code: Select all
Filter chain halted as #<Proc:[email protected]/ .......... http_authentication.rb:112> rendered or redirected
Completed 401 Unauthorized in 4.7ms (ActiveRecord: 2.1ms)


Then a couple of seconds later we see
Code: Select all
Completed 201 Created in 753.2ms


Servoy reports ignores the 401 and reports the 201.
We can see from the data we post that the post comes from the correct IP address, they have identical data. I can't see if both requests include username/password.
Any ideas? Does the http plugin try to post without authentication first?

Christian
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1157
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: http plugin executing request twice?

Postby jcompagner » Thu Dec 04, 2014 5:34 pm

can you see in the logs the full request including the headers of the first and second one?
To see what the difference is?

in code i can't see how there can be a second request (if you don't do executeRequest() somewhere before)
(i can't really fully look into the 3th party http client code)

but if you remove that one executeRequest() line then nothing happens to the server right?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 7971
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 4 guests