Attachment URLs length limit #3512

Closed
opened 2026-02-05 06:56:37 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @gbowsky on GitHub (Feb 16, 2023).

Originally assigned to: @ssddanbrown on GitHub.

Describe the Bug

Hi there! Was trying to upload an url attachments in editor, but noticed some urls not working. Figured out there is 192 character limit according to end result after creating attachment.

Also can be reproduced via API.

Steps to Reproduce

  1. Create page in a book;
  2. Open attachments sidebar
  3. Open interface with link attachment creation;
  4. Attach link with length higher than 192;
  5. Check uploaded link's length - should be 192.

Expected Behaviour

According to the HTTP spec, there's no limit to URL's length, but is should be under 2048 characters.

Screenshots or Additional Context

No response

Browser Details

Chrome 109.0.5414.119 (arm64)

Exact BookStack Version

v22.11

PHP Version

PHP 8.1.13

Hosting Environment

Fedora home server (64-bit), Docker image

Originally created by @gbowsky on GitHub (Feb 16, 2023). Originally assigned to: @ssddanbrown on GitHub. ### Describe the Bug Hi there! Was trying to upload an url attachments in editor, but noticed some urls not working. Figured out there is 192 character limit according to end result after creating attachment. Also can be reproduced via API. ### Steps to Reproduce 1. Create page in a book; 2. Open attachments sidebar 3. Open interface with link attachment creation; 4. Attach link with length higher than 192; 5. Check uploaded link's length - should be 192. ### Expected Behaviour According to the HTTP spec, there's no limit to URL's length, but is should be under 2048 characters. ### Screenshots or Additional Context _No response_ ### Browser Details Chrome 109.0.5414.119 (arm64) ### Exact BookStack Version v22.11 ### PHP Version PHP 8.1.13 ### Hosting Environment Fedora home server (64-bit), Docker image
OVERLORD added the 🐛 Bug label 2026-02-05 06:56:37 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 20, 2023):

Thanks @gbowsky.
I've now increased limits to 2000 within commit c80396136f.
This will be part of the next feature release.

I did test a 64,000 limit, but anything above 2k significant increases chance of issues with http-handling middle-ware since these URLs may be used as redirect headers, and I'd rather catch those scenarios in-app rather than lead the user to a server error.
Longer URLs could always be embedded within page content if really needed.

@ssddanbrown commented on GitHub (Feb 20, 2023): Thanks @gbowsky. I've now increased limits to 2000 within commit c80396136f1f34dce643ff5649e74e67449e6f78. This will be part of the next feature release. I did test a 64,000 limit, but anything above 2k significant increases chance of issues with http-handling middle-ware since these URLs may be used as redirect headers, and I'd rather catch those scenarios in-app rather than lead the user to a server error. Longer URLs could always be embedded within page content if really needed.
Author
Owner

@gbowsky commented on GitHub (Mar 1, 2023):

ty

@gbowsky commented on GitHub (Mar 1, 2023): ty
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3512