prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  GET on /v1/admin returns 404
  The expected address for built-in admin plugin is `/v1/admin/`. But if you forget the trailing slash and type `/v1/admin` you get a 404. I think it would be better to raise a 307.
  
  Related to #112 and #858.
  
  ```
  > http get localhost:8888/v1/admin/
  HTTP/1.1 200 OK
  (...)
  
  > http get localhost:8888/v1/admin
  HTTP/1.1 404 Not Found
  (...)
  ```
  
  
  GET on /v1/admin returns 404
  The expected address for built-in admin plugin is `/v1/admin/`. But if you forget the trailing slash and type `/v1/admin` you get a 404. I think it would be better to raise a 307.
  
  Related to #112 and #858.
  
  ```
  > http get localhost:8888/v1/admin/
  HTTP/1.1 200 OK
  (...)
  
  > http get localhost:8888/v1/admin
  HTTP/1.1 404 Not Found
  (...)
  ```
  
  
  
  </issue>
  <code>
  [start of kinto/plugins/admin/__init__.py]
  1 from pyramid.static import static_view
  2 
  3 
  4 def includeme(config):
  5     # Process settings to remove storage wording.
  6 
  7     # Expose capability.
  8     config.add_api_capability(
  9         "admin",
  10         version="1.6.0",
  11         description="Serves the admin console.",
  12         url="https://github.com/Kinto/kinto-admin/",
  13     )
  14 
  15     build_dir = static_view('kinto.plugins.admin:build', use_subpath=True)
  16     config.add_route('catchall_static', '/admin/*subpath')
  17     config.add_view(build_dir, route_name="catchall_static")
  18
  [end of kinto/plugins/admin/__init__.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/kinto/plugins/admin/__init__.py b/kinto/plugins/admin/__init__.py
  --- a/kinto/plugins/admin/__init__.py
  +++ b/kinto/plugins/admin/__init__.py
  @@ -1,4 +1,5 @@
   from pyramid.static import static_view
  +from pyramid.httpexceptions import HTTPTemporaryRedirect
   
   
   def includeme(config):
  @@ -15,3 +16,10 @@
       build_dir = static_view('kinto.plugins.admin:build', use_subpath=True)
       config.add_route('catchall_static', '/admin/*subpath')
       config.add_view(build_dir, route_name="catchall_static")
  +
  +    # Setup redirect without trailing slash.
  +    def admin_redirect_view(request):
  +        raise HTTPTemporaryRedirect(request.path + '/')
  +
  +    config.add_route('admin_redirect', '/admin')
  +    config.add_view(admin_redirect_view, route_name="admin_redirect")
  
verification_info: {"golden_diff": "diff --git a/kinto/plugins/admin/__init__.py b/kinto/plugins/admin/__init__.py\n--- a/kinto/plugins/admin/__init__.py\n+++ b/kinto/plugins/admin/__init__.py\n@@ -1,4 +1,5 @@\n from pyramid.static import static_view\n+from pyramid.httpexceptions import HTTPTemporaryRedirect\n \n \n def includeme(config):\n@@ -15,3 +16,10 @@\n     build_dir = static_view('kinto.plugins.admin:build', use_subpath=True)\n     config.add_route('catchall_static', '/admin/*subpath')\n     config.add_view(build_dir, route_name=\"catchall_static\")\n+\n+    # Setup redirect without trailing slash.\n+    def admin_redirect_view(request):\n+        raise HTTPTemporaryRedirect(request.path + '/')\n+\n+    config.add_route('admin_redirect', '/admin')\n+    config.add_view(admin_redirect_view, route_name=\"admin_redirect\")\n", "issue": "GET on /v1/admin returns 404\nThe expected address for built-in admin plugin is `/v1/admin/`. But if you forget the trailing slash and type `/v1/admin` you get a 404. I think it would be better to raise a 307.\r\n\r\nRelated to #112 and #858.\r\n\r\n```\r\n> http get localhost:8888/v1/admin/\r\nHTTP/1.1 200 OK\r\n(...)\r\n\r\n> http get localhost:8888/v1/admin\r\nHTTP/1.1 404 Not Found\r\n(...)\r\n```\r\n\r\n\nGET on /v1/admin returns 404\nThe expected address for built-in admin plugin is `/v1/admin/`. But if you forget the trailing slash and type `/v1/admin` you get a 404. I think it would be better to raise a 307.\r\n\r\nRelated to #112 and #858.\r\n\r\n```\r\n> http get localhost:8888/v1/admin/\r\nHTTP/1.1 200 OK\r\n(...)\r\n\r\n> http get localhost:8888/v1/admin\r\nHTTP/1.1 404 Not Found\r\n(...)\r\n```\r\n\r\n\n", "before_files": [{"content": "from pyramid.static import static_view\n\n\ndef includeme(config):\n    # Process settings to remove storage wording.\n\n    # Expose capability.\n    config.add_api_capability(\n        \"admin\",\n        version=\"1.6.0\",\n        description=\"Serves the admin console.\",\n        url=\"https://github.com/Kinto/kinto-admin/\",\n    )\n\n    build_dir = static_view('kinto.plugins.admin:build', use_subpath=True)\n    config.add_route('catchall_static', '/admin/*subpath')\n    config.add_view(build_dir, route_name=\"catchall_static\")\n", "path": "kinto/plugins/admin/__init__.py"}]}