You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/error-handling.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,19 @@
2
2
3
3
The route handler of this package is designed to be robust against invalid options, paths and file names, while also not exposing additional information of your applications public directory structure.
4
4
5
+
## HTTP Status Codes
6
+
5
7
This is why the route handler will return a plain `404` response if:
6
8
7
9
- a requested image does not exist at the specified path
8
10
- the requested image is not a valid image file
9
11
- the provided options are not in the correct format (`key=value`, no trailing comma, etc.)
10
12
11
-
The only other HTTP error that can be returned is a `429` response, which indicates that the request was rate-limited.
13
+
The only two other HTTP errors that can be returned are:
14
+
- a `429` response, which indicates that the request was rate-limited
15
+
- a `403` response, which indicates that the request was unauthorized (e.g. when using signed URLs and the signature is invalid or expired)
16
+
17
+
## Invalid options
12
18
13
19
If parts of the given route options are invalid, the route handler will ignore them and only apply the valid options.
This package provides the option to generate signed URLs for images from specific source directories powered by [Laravel's URL signing feature](https://laravel.com/docs/urls#signed-urls).
4
+
5
+
This can be useful for securing access to images that should not be publicly accessible without proper authorization or only in a scaled down version.
6
+
7
+
::: info
8
+
Signed URLs also ensure that the provided options cannot be modified client-side.
9
+
:::
10
+
11
+
::: warning
12
+
The Signed URL feature does not restrict access to public images.
13
+
If you want to secure access to images, ensure that the source directories you want signed URLs for are not publicly accessible.
14
+
:::
15
+
16
+
## Setup
17
+
18
+
To enable signed URLs, set the `signed_urls.enabled` option to `true` in your `image-transform-url.php` configuration.
19
+
20
+
You then need to specify the source directories for which signed URLs should apply to in the `signed_urls.source_directories` array.
0 commit comments