Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle redirections #44

Open
dehy opened this issue Feb 24, 2016 · 1 comment
Open

Handle redirections #44

dehy opened this issue Feb 24, 2016 · 1 comment

Comments

@dehy
Copy link

dehy commented Feb 24, 2016

Actually, the server fails if it find redirections. It would be great if we could configure the number of max redirections to follow before failure.

picfit-1 | 2016-02-24T09:36:38.539447359Z time="2016-02-24T09:36:38Z" level="info" msg="started handling request" method="GET" remote="172.17.0.13:40641" request="/display?url=http%3A%2F%2Fcoverartarchive.org%2Frelease%2F1919faf1-61d8-4741-a530-4afbaed125c9%2F6972823009.jpg&w=512&h=512&op=resize&fmt=jpg" 
picfit-1 | 2016-02-24T09:36:38.539841822Z time="2016-02-24T09:36:38Z" level="info" msg="Key cdaaa10ccbf85f4718b300135e84671b not found in kvstore"
picfit-1 | 2016-02-24T09:36:38.872947671Z time="2016-02-24T09:36:38Z" level="info" msg="PANIC: Get http://archive.org/download/mbid-1919faf1-61d8-4741-a530-4afbaed125c9/mbid-1919faf1-61d8-4741-a530-4afbaed125c9-6972823009.jpg: Error redirecting. MaxRedirects reached\ngoroutine 416 [running]:\ngithub.com/thoas/picfit/middleware.(*Recovery).ServeHTTP.func1(0x7fa84f6fb278, 0xc820254600, 0xc82019a280, 0xc8202261c0)\n\t/go/src/github.com/thoas/picfit/middleware/middleware.go:36 +0x10a\npanic(0x9866a0, 0xc82019a2c0)\n\t/usr/local/go/src/runtime/panic.go:426 +0x4e9\ngithub.com/thoas/picfit/application.glob.func4(0x7fa84f6fb278, 0xc820254600, 0xc82015e1e0, 0xc8200981b0)\n\t/go/src/github.com/thoas/picfit/application/handlers.go:22 +0x86\ngithub.com/thoas/picfit/application.(*Application).ServeHTTP.func1(0x7fa84f6fb278, 0xc820254600, 0xc8202261c0)\n\t/go/src/github.com/thoas/picfit/application/application.go:114 +0x2b6\nnet/http.HandlerFunc.ServeHTTP(0xc82012f720, 0x7fa84f6fb278, 0xc820254600, 0xc8202261c0)\n\t/usr/local/gpicfit-1 | 2016-02-24T09:36:48.710753471Z time="2016-02-24T09:36:48Z" level="info" msg="Started GET /display" 
@thoas
Copy link
Owner

thoas commented Feb 25, 2016

Good idea 👍

@thoas thoas modified the milestone: 0.5.0 Aug 16, 2016
@thoas thoas removed this from the 0.5.0 milestone May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants