mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 07:47:07 +00:00
Use ETag middleware
This commit is contained in:
@@ -83,6 +83,9 @@ app.map({
|
|||||||
|
|
||||||
app.use(mw.auth.authentify);
|
app.use(mw.auth.authentify);
|
||||||
|
|
||||||
|
// Don't process the request if the data hasn't changed
|
||||||
|
app.use(mw.etag.ifNoneMatch);
|
||||||
|
|
||||||
// We must be authenticated before we can access these
|
// We must be authenticated before we can access these
|
||||||
app.map({
|
app.map({
|
||||||
'/project': {
|
'/project': {
|
||||||
@@ -274,12 +277,12 @@ app.map({
|
|||||||
},
|
},
|
||||||
'/queue/outgoing/': {
|
'/queue/outgoing/': {
|
||||||
'asaqc': {
|
'asaqc': {
|
||||||
get: [ mw.queue.asaqc.get ],
|
get: [ mw.etag.noSave, mw.queue.asaqc.get ],
|
||||||
post: [ mw.auth.access.write, mw.queue.asaqc.post ],
|
post: [ mw.auth.access.write, mw.queue.asaqc.post ],
|
||||||
'/project/:project': {
|
'/project/:project': {
|
||||||
get: [ mw.queue.asaqc.get ],
|
get: [ mw.etag.noSave, mw.queue.asaqc.get ],
|
||||||
'/sequence/:sequence': {
|
'/sequence/:sequence': {
|
||||||
get: [ mw.queue.asaqc.get ],
|
get: [ mw.etag.noSave, mw.queue.asaqc.get ],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'/:id': {
|
'/:id': {
|
||||||
@@ -303,6 +306,10 @@ app.map({
|
|||||||
//
|
//
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.use(mw.etag.save);
|
||||||
|
// Invalidate cache on database events
|
||||||
|
mw.etag.watch(app);
|
||||||
|
|
||||||
// Generic error handler. Stops stack dumps
|
// Generic error handler. Stops stack dumps
|
||||||
// being sent to clients.
|
// being sent to clients.
|
||||||
app.use(function (err, req, res, next) {
|
app.use(function (err, req, res, next) {
|
||||||
|
|||||||
Reference in New Issue
Block a user