Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event Images Aren't Verified #34

Open
Xevion opened this issue Sep 25, 2023 · 0 comments
Open

Event Images Aren't Verified #34

Xevion opened this issue Sep 25, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed rework Something existing needs to be redeveloped or modified

Comments

@Xevion
Copy link
Member

Xevion commented Sep 25, 2023

Images for events are intended to be stable URLs that resolve to a PNG or JPEG image; but there is no verification. While it was intended to be a decent solution allowing dynamic media to be referenced, it appears this usage is not implicit and officers are linking media that is impossible for browsers to resolve properly.

For example

  • https://drive.google.com/file/d/1XsOSfLbvJ1Z-RlByTvnMxPlR785qu2G5/view
  • https://acmutsa.notion.site/All-Logos-41efcfae57324beb816f136c0756b16a#5e9b9c427ae64d849ad0f0d468a20ce4

These URLs are pages - they won't resolve. Browsers won't HTTPS images back. Even worse, I believe if the officers had done it properly (gotten a valid Content-Type returned), the image used may have been unstable; temporary. And not resolve after days or even hours.

For now, before proper media upload is implemented, a verification process needs to be created. This process needs to be server-side to eliminate potential errors from locally available images (localhost, intranet).

The check should make sure of the following, and return the reason (if any) for failure:

  • Content Type is jpeg, png (use mime-types, headers)
  • Maximum size (<= 1536 KB)
  • The URL must be HTTPS

Potential other checks:

  • Responds to HEAD requests
  • Responds well to referred requests (emulate headers used by a browser, to eliminate bad URLs protected by hotlink protection/zone referrers)
  • Multi-request matrix
  • Ends with an expected suffix
  • Comes from an expected domain (*.google.com, *.imgur.com).
  • Within a certain aspect ratio range (1/3 to 3/1)
  • Minimum size (>= 10KB)
  • Minimum resolution (W > 100 && H > 80)
@Xevion Xevion added enhancement New feature or request help wanted Extra attention is needed rework Something existing needs to be redeveloped or modified labels Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed rework Something existing needs to be redeveloped or modified
Projects
None yet
Development

No branches or pull requests

1 participant