duct-framework / duct-framework/module.web

:middleware doesn't effect static files.

Open
#7 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
22
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Middleware added to the :duct.core/handler :middleware vector doesn't seem to have any effect on static files. This is unfortunate, as gzip (added via the ring-gzip middleware) is hugely important for compiled cljs.

Middleware correctly effects routes using :duct.router/cascading. However, "resource" compojure routes added using :duct.router/cascading don't seem to do anything, so that's little help.

The best solution I've been able to find is to explicitely declare a :duct.server.http with a handler that wraps the :duct.core/handler in whatever middleware I desire. This, I feel, is kludgy and inelegant compared to declaring a :handler :middleware.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by tracing how :duct.core/handler applies the :middleware vector and how :duct.router/cascading handles resource routes. Reproduce the issue with a static file and ring-gzip, comparing it with a normal route. Done means declared middleware affects static files without requiring an explicit :duct.server.http handler wrapper.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.