-
Notifications
You must be signed in to change notification settings - Fork 22
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
Connect Middleware should return 404 if coordinates are out of bounds #31
Comments
@yuletide Maybe Other options:
Thoughts? |
This would be a perfect opportunity to document interfaces in unit tests... If we're going by return value, I would rather they return a I also will defer on what the implications are of passing back an out-of-bounds value. |
When we 404, should we return JSON with the specific error, or should we embed that in an image (big red 404 images with the error text overlaid?) |
Definitely NOT an image. Don't really care what the content we send back is otherwise. |
We should investigate what other servers do first. Definitely not 404 images. But we don't want "missing image" placeholders to show up in the client either. Alex Yule On Tuesday, January 29, 2013 at 3:29 PM, Rob Brackett wrote:
|
Well, a client that doing anything remotely reasonable shouldn't ever request such an image, right? If they're at a zoom level where there are 256x256 tiles, we're talking about the client asking for tile (256, 256), when it should be asking for tile (0, 256). I suppose we could also warp the results around so: Request (256, 0) --> (0, 0) |
OSM returns a 404 with HTML and does not wrap around: |
Mapbox, on the other hand, does what we are currently doing: Not a 404 and also returns an image (just with nothing in it) |
Google returns a 400 (which actually makes more sense now that I think about it) rendered as HTML: |
So:
|
I made a brief fix today so that our URL matching properly matches any series of three numbers (at deep enough zoom levels, you could easily have numbers that were too many digits to match).
However, we should probably actually check that the requested coordinates are in-bounds when projecting and return a 404 if they aren't.
(Note that the current situation is safe: we render an empty image and send that back if the coordinates are out of bounds. It would be better to be smart enough not to render anything in that case, though.)
The text was updated successfully, but these errors were encountered: