I'm trying to find a solution in the Web to this issue, when a server sends an HTTL response code 303 (redirect) and the new location (URL) is identical to the original location. Until now I couldn't find a solution in the Web. But obviously there mustbe a solution since my web browser can handle this.
Any ideas on your side?
On 12/06/2023 14:32, Alexandru wrote:must be a solution since my web browser can handle this.
I'm trying to find a solution in the Web to this issue, when a server sends an HTTL response code 303 (redirect) and the new location (URL) is identical to the original location. Until now I couldn't find a solution in the Web. But obviously there
Any ideas on your side?
Check carefully. Are the URLs really exactly the same? I remember I had
to look twice when I fetched a URL like "http://www.tcl.tk/about" and
got a redirect to "/about/. The trailing slash makes a difference.
The only way a browser can "handle" a redirect to the exact same URL it requested is by displaying a page that says something like "The page
isn’t redirecting properly". But I guess that's not what you are
referring to.
Schelte.
I double checked, the URLs are identical, including the trailing slash.
This is the URL and the siplified code:
HTTP/1.1 200 OK
Schelte schrieb am Montag, 12. Juni 2023 um 17:37:56 UTC+2:
On 12/06/2023 16:45, Alexandru wrote:
I double checked, the URLs are identical, including the trailing slash. This is the URL and the siplified code:
The code doesn't run as presented. But indeed the URLs are the same. However, the first response also returns some cookies. Repeating the request with those cookies results in a 200 OK.
My www package (https://chiselapp.com/user/schelte/repository/www/index) takes care of redirects and cookies. Fetching the URL that way (you'll
need the latest check-in) works correctly:
package require www
catch {www get https://www.duma-bandzink.com/de/} data info
dict get $info status line
HTTP/1.1 200 OK
Schelte.Hi Shelte,
Many thanks, the cookies could be the cause indeed.
I'll take a look at your code.
Regards
Alexandru
On 12/06/2023 16:45, Alexandru wrote:
I double checked, the URLs are identical, including the trailing slash. This is the URL and the siplified code:
The code doesn't run as presented. But indeed the URLs are the same.
However, the first response also returns some cookies. Repeating the
request with those cookies results in a 200 OK.
My www package (https://chiselapp.com/user/schelte/repository/www/index) takes care of redirects and cookies. Fetching the URL that way (you'll
need the latest check-in) works correctly:
package require www
catch {www get https://www.duma-bandzink.com/de/} data info
dict get $info status line
HTTP/1.1 200 OK
Schelte.
On 12/06/2023 16:45, Alexandru wrote:
I double checked, the URLs are identical, including the trailing slash.The code doesn't run as presented. But indeed the URLs are the same.
This is the URL and the siplified code:
However, the first response also returns some cookies. Repeating the
request with those cookies results in a 200 OK.
How where should I save your package?
I unpacked the ZIP archive to C:\Tcl\lib\www but package require www fails...
On 12/06/2023 18:41, Alexandru wrote:
How where should I save your package?As it is a Tcl module, you have to put it in one of the directories
I unpacked the ZIP archive to C:\Tcl\lib\www but package require www fails...
returned from [tcl::tm::path list], or add the directory where you put
it to that list, using [tcl::tm::path add C:/Tcl/lib/www].
Schelte.
Schelte schrieb am Montag, 12. Juni 2023 um 21:27:20 UTC+2:
On 12/06/2023 18:41, Alexandru wrote:
How where should I save your package?As it is a Tcl module, you have to put it in one of the directories returned from [tcl::tm::path list], or add the directory where you put
I unpacked the ZIP archive to C:\Tcl\lib\www but package require www fails...
it to that list, using [tcl::tm::path add C:/Tcl/lib/www].
Schelte.Well, I'm a little bit familiar with the Tcl basics. I put your package as any other package into the recognized directory C:/Tcl/lib.
Should your archive have a pkgIndex.tcl ?
This file is not available so no wonder is not working.
I tried to define the pkgIndex.tcl with this content:
package ifneeded www 2.3 [list source [file join $dir www-2.3.tm]]
This give me the error:
attempt to provide package www 2.3 failed: no version of package www provided
Alexandru schrieb am Dienstag, 13. Juni 2023 um 15:32:13 UTC+2:
Schelte schrieb am Montag, 12. Juni 2023 um 21:27:20 UTC+2:
On 12/06/2023 18:41, Alexandru wrote:
How where should I save your package?As it is a Tcl module, you have to put it in one of the directories returned from [tcl::tm::path list], or add the directory where you put
I unpacked the ZIP archive to C:\Tcl\lib\www but package require www fails...
it to that list, using [tcl::tm::path add C:/Tcl/lib/www].
Schelte.Well, I'm a little bit familiar with the Tcl basics. I put your package as any other package into the recognized directory C:/Tcl/lib.
Should your archive have a pkgIndex.tcl ?
This file is not available so no wonder is not working.
I tried to define the pkgIndex.tcl with this content:
package ifneeded www 2.3 [list source [file join $dir www-2.3.tm]]
This give me the error:
attempt to provide package www 2.3 failed: no version of package www providedAh sorry, I think I know what the problem is. The tm are expected in another location than the normal libraries.
Forget my last post.
Now I put the www directory directory into one of the paths returned by [tcl::tm::path list] and it can still not find the package.
On 13/06/2023 15:43, Alexandru wrote:
Now I put the www directory directory into one of the paths returned by [tcl::tm::path list] and it can still not find the package.The module system doesn't look in subdirectories. That was one of its
design goals: avoid delays due to scanning large portions of the file
system. So you should put the contents of the www directory in a path returned by [tcl::tm::path list].
Alternatively, you can indicate that the package is in the www
subdirectory: package require www::www. That will work for this specific case. But it will mess things up if one of the sub packages is needed,
such as www::digest, which should now be loaded as www::www::digest.
I didn't include an installation part in the documentation because it is
just a normal Tcl module. But if even a long-time Tcl user like yourself
is struggling with it, I guess I may have to add it.
Schelte.
Schelte schrieb am Dienstag, 13. Juni 2023 um 16:27:00 UTC+2:
On 13/06/2023 15:43, Alexandru wrote:
Now I put the www directory directory into one of the paths returned by [tcl::tm::path list] and it can still not find the package.The module system doesn't look in subdirectories. That was one of its design goals: avoid delays due to scanning large portions of the file system. So you should put the contents of the www directory in a path returned by [tcl::tm::path list].
Alternatively, you can indicate that the package is in the www subdirectory: package require www::www. That will work for this specific case. But it will mess things up if one of the sub packages is needed,
such as www::digest, which should now be loaded as www::www::digest.
I didn't include an installation part in the documentation because it is just a normal Tcl module. But if even a long-time Tcl user like yourself
is struggling with it, I guess I may have to add it.
Schelte.Thanks, now it loads the package.
I'll test it.
Regards
Alexandru
When trying to open another URL (https://www.avi-gmbh.com/) your code throws and error that that aborts the my program flow, although I use catch
On 13/06/2023 17:58, Alexandru wrote:
When trying to open another URL (https://www.avi-gmbh.com/) your code throws and error that that aborts the my program flow, although I use catchThank you for this example of a failing scenario. I will investigate why
it is not handled correctly. But this may take some time.
Thanks,
Schelte.
Did you find time to look into this issue?
I have a task where I could use your package if it can catch communication errors.
On 19/07/2023 09:55, Alexandru wrote:
Did you find time to look into this issue?I did have a quick look. But in my simple test, it doesn't behave
I have a task where I could use your package if it can catch communication errors.
consistent. Sometimes the error is caught. Other times it takes a while before it is reported via the background error handler. That makes
debugging harder. And then I got distracted by other things :-}
But knowing there is a real need for this, increases the priority. I
will have another go at it.
Schelte.
On 7/19/2023 4:52 AM, Alexandru wrote:
Yes, there is a real need. Thanks for the help.
Regards
Alexandru
Would you care to describe what you are doing with these websites?
Depending on your use, there may be other options.
Like: are you just downloading them to a local file? or checking
whether they are up and running? etc.
Yes, there is a real need. Thanks for the help.
Regards
Alexandru
Did you find time to look into this issue?
I have a task where I could use your package if it can catch communication errors.
On 19/07/2023 09:55, Alexandru wrote:
Did you find time to look into this issue?I have found a problem and fixed it. In my testing, the latest committed version of the www package now consistently allows catching the error to access the URL you mentioned. Please let me know if you encounter any
I have a task where I could use your package if it can catch communication errors.
more problems.
Thanks,Thanks Schelte, I'll run the code with your updated package right away and give you feedback.
Schelte.
On 19/07/2023 09:55, Alexandru wrote:
Did you find time to look into this issue?I have found a problem and fixed it. In my testing, the latest committed version of the www package now consistently allows catching the error to access the URL you mentioned. Please let me know if you encounter any
I have a task where I could use your package if it can catch communication errors.
more problems.
Thanks,Your new code breaks earlier now at this link and with this error:
Schelte.
Schelte schrieb am Freitag, 21. Juli 2023 um 21:48:13 UTC+2:
I have found a problem and fixed it. In my testing, the latest committedYour new code breaks earlier now at this link and with this error:
version of the www package now consistently allows catching the error to
access the URL you mentioned. Please let me know if you encounter any
more problems.
Thanks,
Schelte.
Getting https://globalautomationtechnologies.com/...(622/7537)
On 7/21/2023 4:11 PM, Alexandru wrote:Thanks for the hint.
Schelte schrieb am Freitag, 21. Juli 2023 um 21:48:13 UTC+2:
I have found a problem and fixed it. In my testing, the latest committed >> version of the www package now consistently allows catching the error to >> access the URL you mentioned. Please let me know if you encounter anyYour new code breaks earlier now at this link and with this error:
more problems.
Thanks,
Schelte.
Getting https://globalautomationtechnologies.com/...(622/7537)I noticed that whenever you get these errors, Firefox and Chrome also complain. It is because these sites do not have their certificates setup
but the url's start with https. If you use http instead in the same
url's, it works and redirect works.
Thanks for the hint.
Still, changing the URL from https to https won't solve the problem, since other sites will fail because of http.
Parsing 7000 sites need an error catching system.
On 7/21/2023 6:43 PM, Alexandru wrote:
Thanks for the hint.
Still, changing the URL from https to https won't solve the problem, since other sites will fail because of http.What I meant was that you have been given bad data. You may want raise
Parsing 7000 sites need an error catching system.
it up with whoever gave it to you. I any case, 7_000 sounds like a lot
to process. I am curious how long it takes.
saitology9 schrieb am Samstag, 22. Juli 2023 um 01:03:32 UTC+2:
On 7/21/2023 6:43 PM, Alexandru wrote:
Thanks for the hint.What I meant was that you have been given bad data. You may want raise
Still, changing the URL from https to https won't solve the problem, since other sites will fail because of http.
Parsing 7000 sites need an error catching system.
it up with whoever gave it to you. I any case, 7_000 sounds like a lot
to process. I am curious how long it takes.
Yes, partly bad data, can't do a thing about it, that's how it is.
The time is not an issue, few hours maybe.
On 22/07/2023 01:10, Alexandru wrote:
saitology9 schrieb am Samstag, 22. Juli 2023 um 01:03:32 UTC+2:
On 7/21/2023 6:43 PM, Alexandru wrote:
Thanks for the hint.What I meant was that you have been given bad data. You may want raise
Still, changing the URL from https to https won't solve the problem, since other sites will fail because of http.
Parsing 7000 sites need an error catching system.
it up with whoever gave it to you. I any case, 7_000 sounds like a lot
to process. I am curious how long it takes.
Yes, partly bad data, can't do a thing about it, that's how it is.This bad data is good for stress testing the www library. :-D
The time is not an issue, few hours maybe.
The latest bug you encountered should be fixed now.
Thanks,
Schelte
Just a little bit further, the code hangs at this URL: https://ide-gmbh.com/en/
This is position 1231 of 7537 URLs in my list.
FireFox also hangs a while, then returns:
"Fehler: Umleitungsfehler
Beim Verbinden mit www.ide-gmbh.com trat ein Fehler auf.
Dieses Problem kann manchmal auftreten, wenn Cookies deaktiviert oder abgelehnt werden.
"
On 22/07/2023 22:07, Alexandru wrote:
Just a little bit further, the code hangs at this URL: https://ide-gmbh.com/en/
This is position 1231 of 7537 URLs in my list.
FireFox also hangs a while, then returns:This web site redirects to itself. There already was an (undocumented)
"Fehler: Umleitungsfehler
Beim Verbinden mit www.ide-gmbh.com trat ein Fehler auf.
Dieses Problem kann manchmal auftreten, wenn Cookies deaktiviert oder abgelehnt werden.
"
option to limit the number of redirections. I have made an update to set
the default limit to 20, instead of allowing unlimited redirections.
Thanks,Perfect! Now, all 7535 URLs run through without any errors.
Schelte.
Perfect! Now, all 7535 URLs run through without any errors.
Many thanks, Schelte!
Cheers
Alexandru
On 23/07/2023 19:42, Alexandru wrote:
Perfect! Now, all 7535 URLs run through without any errors.
Many thanks, Schelte!
Cheers
Alexandru
Thank you for running the stress test and identifying some weak points
of the www library.
Schelte.
@Schelte, I am not familiar with the www package. Is it a replacement
for tcllib's http? or is it something else altogether?
I created the www package to fulfill these requirements.
For more information, see https://chiselapp.com/user/schelte/repository/www
Schelte.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (3 / 13) |
| Uptime: | 16:09:52 |
| Calls: | 12,103 |
| Calls today: | 3 |
| Files: | 15,004 |
| Messages: | 6,518,055 |