Skip to content

Commit

Permalink
Restrict certificates route to Grover middleware
Browse files Browse the repository at this point in the history
Grover turns the html output of the certificates#show action into a PDF response, but we don't want to expose HTML format as a valid response.
So limit the route to Grover middleware requests.
  • Loading branch information
steventux committed Apr 11, 2024
1 parent c955191 commit a2a9411
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config/routes/aytq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

resource :start, only: [:show]

resources :certificates, only: [:show]
resources :certificates, only: [:show],
constraints: ->(req) { req.env["Rack-Middleware-Grover"] == "true" }

resource :identity_user, only: [:show]
resource :npq_certificate, only: [:show]

Expand Down

0 comments on commit a2a9411

Please sign in to comment.