[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #16907 [Onionoo]: Stop returning a 500 Internal Server Error when the hourly updater has not run for 6+ hours
#16907: Stop returning a 500 Internal Server Error when the hourly updater has not
run for 6+ hours
-------------------------+------------------------------
Reporter: karsten | Owner:
Type: enhancement | Status: needs_review
Priority: Medium | Milestone:
Component: Onionoo | Version:
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Sponsor: |
-------------------------+------------------------------
Comment (by karsten):
iwakeh, teor, thanks for the comments. Agreed!
virgil, if you really want to keep the current behavior in your
application, maybe there's a way to achieve that: just include an `If-
Modified-Since` header with a timestamp six hours ago, and you'll either
get a 200 status code if content was modified since then or a 304 status
code if it hasn't. Example (with a timestamp six minutes ago):
{{{
$ date -u
Fri Jan 8 08:32:30 UTC 2016
$ curl -H "If-Modified-Since: Fri, 08 Jan 2016 08:26:30 GMT" -v
https://onionoo.torproject.org/summary?limit=0
* Trying 154.35.132.148...
* Connected to onionoo.torproject.org (154.35.132.148) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: *.torproject.org
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> GET /summary?limit=0 HTTP/1.1
> Host: onionoo.torproject.org
> User-Agent: curl/7.43.0
> Accept: */*
> If-Modified-Since: Fri, 08 Jan 2016 08:26:30 GMT
>
< HTTP/1.1 304 Not Modified
< Date: Fri, 08 Jan 2016 08:33:08 GMT
< Server: Apache
< Cache-Control: public, max-age=300
<
* Connection #0 to host onionoo.torproject.org left intact
}}}
And if you want to receive content in either case, just leave out that
header and decide whether to display a warning based on the server's
`Last-Modified` header. I think we don't have change the Onionoo protocol
for anything here.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/16907#comment:17>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs