fix(security): http://analytics.flisk.si/ serves 200 instead of redirecting to https

Open Beginner friendly
#11 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript

Research direction

Reproduce with the curl command in the issue to confirm the 200 with no redirect. Then find the Worker's request handler — the entry module the Worker config points at — and check whether it looks at the request URL scheme; the 301 belongs there if the zone-level always-use-HTTPS setting is not the chosen route. Done means the curl check prints 301 with an https Location, the same URL over https still returns 200, and both are captured as tests.

Written by the indexing model from the issue text.

Description

agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests

Problem

http://analytics.flisk.si/ serves the page with status 200 instead of redirecting to https://. The site is a tracking dashboard, so a visitor on an open network can be served the page, and its scripts, over plain HTTP.

Reproduce:

  1. Run curl -s -o /dev/null -w '%{http_code} %{redirect_url}' http://analytics.flisk.si/.
  2. It prints 200 with no redirect URL.

Expected: a 301 to the https URL. The same fix was filed for the other Flisk sites (host, inference, gardener, os, tools, chat, fleet); pages.flisk.si already redirects.

Root Cause Analysis

The zone does not force HTTPS for this hostname, and the Worker does not check the request scheme itself.

TDD Fix Plan

  1. RED: Write a check that a plain-HTTP request to the site returns 301 with a Location on https.
    GREEN: Enable the always-use-HTTPS rule for the hostname or redirect in the Worker.

  2. RED: Write a check that the https request still returns 200.
    GREEN: Keep the redirect on http only.

REFACTOR: Document the rule once for all flisk.si hostnames.

Acceptance Criteria

  • http://analytics.flisk.si/ returns 301 to https
  • The https page still returns 200
  • All new tests pass
  • Existing tests still pass
Dominant language
JavaScript
Stars
0
Forks
2
Avg merge
1h 33m
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flisk-sh/analytics

All issues in flisk-sh/analytics

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.