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)
- How are comments/like/dislikes synced? HOT 2
- A `Video` object does not contain the group as a target in to/cc/audience HOT 2
- Cannot compute FPS because 0 is lower than our minimum value 1 HOT 5
- Playback issue with range (position) with unusual video framerate HOT 4
- Turkish translation HOT 1
- trying to restore sql db is failining HOT 2
- Error log on server: "Cannot read properties of undefined (reading 'isBlacklisted')" HOT 1
- Settings of type "password" triggers the browser password store HOT 4
- "Stats" button appears for remote video HOT 1
- Plugin new version notification is always showing the latest plugin version, even for old notifications
- Index plugins/themes on first startup, for better user experience for new admins. HOT 1
- Error on FreeBSD when following instructions on diffing configuration changes HOT 1
- Server crashes with "Error: write EPIPE" HOT 5
- Possibility to increase maxAttempts for s3 uploads
- Peertube won't start: "permission denied for schema public" HOT 1
- Question mark "?" in front of user email in webadmin HOT 7
- OAuth 2FA in Documentation HOT 1
- Dereference error type field in REST API documentation HOT 1
- All transcoding jobs result in an error: Output format mp4 is not available HOT 5
- Peertube doesn't display channels HOT 2
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.