StatistikStadtZuerich / stat.stadt-zuerich.ch

API Backend for the linked open statistical data of the Municipality of Zurich
Other
0 stars 0 forks source link

Handling der Accept-Headers auf Varnish für Zugriff auf Puppetron #42

Open mchlrch opened 6 years ago

mchlrch commented 6 years ago

Zurzeit beantwortet Varnish die Zugriffe auf Puppetron mit 404, wenn sie nicht mit accept:text/html erfolgen.

Folgende Zugriffe müssten m.E. funktionieren:

@l00mi Vermutlich ist das in Varnish konfigurierbar, oder?

mira@blinky:~$ curl -I -H "accept:image/png" http://localhost:3000/screenshot/?url=http://www.google.com
HTTP/1.1 200 OK
content-type: image/png
cache-control: public,max-age=31536000
Date: Tue, 19 Jun 2018 09:21:50 GMT
Connection: keep-alive

mira@blinky:~$ curl -I -H "accept:image/png" http://stat.stadt-zuerich.ch/screenshot/?url=http://www.google.com
HTTP/1.1 404 Not Found
link: <http://stat.stadt-zuerich.ch/api>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"
content-security-policy: default-src 'self'
x-content-type-options: nosniff
content-type: text/html; charset=utf-8
content-length: 150
access-control-allow-origin: *
cache-control: public, max-age=604800
access-control-expose-headers: Link
Date: Tue, 19 Jun 2018 07:57:05 GMT
Vary: Accept
X-Varnish: 2655080 2654989
Age: 5115
Via: 1.1 varnish-v4
Connection: keep-alive

mira@blinky:~$ curl -I -H "accept:text/html" http://stat.stadt-zuerich.ch/screenshot/?url=http://www.google.com
HTTP/1.1 200 OK
content-type: image/png
cache-control: public,max-age=31536000
Date: Tue, 19 Jun 2018 09:22:34 GMT
Vary: Accept
X-Varnish: 2559341
Age: 0
Via: 1.1 varnish-v4
Accept-Ranges: bytes
Connection: keep-alive
l00mi commented 6 years ago

@mchlrch Genau dass liegt an der Konfiguration von Varnish. Wir evaluieren im Moment noch eine andere Variante die Auslieferung zu gestalten, deshalb die Frage wie dringend ist diese Anforderung?

mchlrch commented 6 years ago

@l00mi Ist nicht dringend. Kein Blocker.