Reuse of URLConnection causes RequestHeader not to work

I have a web app that writes time series data to an influxdb instance, it uses a URLConnection that does the api request. It needs to have an “Authorization: Token …” header present.

I had this bug where influxdb kept giving me random 403 unauthorised errors. Eventually after capturing the requests via wireshark I found that the Authorization header was only ever getting set to the first request’s and all other calls to “URLConnection.RequestHeader()” were ignored.

The work around has been to create a new URLConnection for every request.

I am using 2021r3, this only happens on linux as far as I can tell, it works correctly on macOS.

Can anyone confirm this behaviour? I didn’t find a bug report, is there one already?

Thanks!

More importantly, have you checked to see if this is fixed in a newer version of Xojo?

I do not have a license to build newer versions. I am just trying to figure out if its a known bug before I report it.

You don’t need a new license to run in the IDE.

Yes, however, the issue is not with macOS (my current OS) its with linux. All my linux systems are headless. I guess i can setup remote debugger to test.

1 Like