Comments (4)
Describe the current behavior
Currently the client can send float value to POST /api/v1/videos/{id}/views, which isn't accepted by the API due to validators.isInt check
isInt returns false when passing a float value:
validator.isInt('13.12123123')
false
The client code that's sending the float is probably this:
PeerTube/client/src/assets/player/shared/peertube/peertube-plugin.ts
Lines 254 to 258 in 01e4fd0
Describe the expected behavior
Either the client should send an int or the API should be more forgiving and converting float to int.
Additional information
-
PeerTube instance:
- URL:
- Version: 6.0.3
- NodeJS version:
- Ffmpeg version:
-
Browser name, version and platforms on which you could reproduce the bug:
-
Link to browser console log if relevant:
-
Link to server log if relevant (
journalctl
or/var/www/peertube/storage/logs/
):
from peertube.
Currently the client can send float value to POST /api/v1/videos/{id}/views, which isn't accepted by the API due to validators.isInt check
Are you sure? In your example I don't see where startTime
can be a float, and other notifyUserIsWatching
calls use Math.floor
(like https://github.com/Chocobozzz/PeerTube/blob/develop/client/src/assets/player/shared/peertube/peertube-plugin.ts#L350)
from peertube.
Yes, at least we see that the REST API receives floats from the web client.
In peertube-plugin.ts startTime
is defined in two places:
The first one is using timeToInt for a reason I guess? I haven't dug deep into this, I've just noticed we receive floats from the web client in our error logs.
from peertube.
Thanks, then I think ca889db will fix the issue. Don't hesitate to comment if you still notice bad requests after applying this patch (don't forget some web browser may still have the old client in cache/as pwa so the user agent can help)
from peertube.
Related Issues (20)
- Search too strict in returning results HOT 2
- Password protected stream - not ask for password HOT 1
- Export chapters as a cue sheet HOT 3
- Transcription highlight color has light text in 6.3.0-rc.1 HOT 2
- Videos on a 6.3.0-rc1 server break federation on earlier instances. HOT 3
- Auth LDAP and cyrillic letters in OU. "lde_dn": null. Backend returned code 400, errorMessage is: Invalid grant: user credentials are invalid HOT 4
- Split sitemap.xml into multiple files when larger than 50,000 URLs
- Provide chapters to search engines
- Firefox version 130.0 : annoncé incompatible peertube HOT 1
- Add all missing config as Docker env HOT 6
- Version 6.3.0 migration script fails HOT 4
- Version 6.3.0 Mobile Video Controls Issue HOT 2
- Add support for deployment on Windows/Windows Server HOT 4
- Transcription Generation Does Not Work HOT 6
- "test suite status" link in readme broken
- Adding a "force audio only" option HOT 3
- Peertube fails to start on query error HOT 9
- After updating, saving the configuration results in "Incorrect request parameters" HOT 4
- 6.3.0 peertube-runner transcodes do not use original uploaded file as input for FFmpeg command HOT 3
- migration script 6.3.0 error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from peertube.