nextcloud / files_downloadlimit

Nextcloud link share download counter
https://apps.nextcloud.com/apps/files_downloadlimit
GNU Affero General Public License v3.0
10 stars 4 forks source link

fix: prevent null token #328

Closed skjnldsv closed 1 month ago

skjnldsv commented 1 month ago

I have no clue how that can happen, because we clearly have the token in the URL, but :shrug:

{
  "reqId": "geRGVLc8I4Nvg8yDzXL6",
  "level": 3,
  "time": "2024-07-22T09:10:34+00:00",
  "remoteAddr": "<IP>",
  "user": "--",
  "app": "index",
  "method": "GET",
  "url": "/s/<share_token>/download?path=OBFUSCATED.pdf.pdf",
  "message": "OCA\\Files_DownloadLimit\\Db\\LimitMapper::get(): Argument #1 ($token) must be of type string, null given, called in /var/www/html/apps/files_downloadlimit/lib/Listener/ShareLinkAccessedListener.php on line 59 in file '/var/www/html/apps/files_downloadlimit/lib/Db/LimitMapper.php' line 37",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0",
  "version": "29.0.3.4",
  "exception": {
    "Exception": "Exception",
    "Message": "OCA\\Files_DownloadLimit\\Db\\LimitMapper::get(): Argument #1 ($token) must be of type string, null given, called in /var/www/html/apps/files_downloadlimit/lib/Listener/ShareLinkAccessedListener.php on line 59 in file '/var/www/html/apps/files_downloadlimit/lib/Db/LimitMapper.php' line 37",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\Files_Sharing\\Controller\\ShareController"
          ],
          "downloadShare"
        ]
      },
Antreesy commented 1 month ago

/backport to stable29

susnux commented 1 month ago

/backport to stable29

skjnldsv commented 1 month ago

/backport to stable29

skjnldsv commented 1 month ago

/backport to stable28

Antreesy commented 1 month ago

Third time's the charm 😁 Thanks!