diff --git a/deploy/package.json b/deploy/package.json
index 2ea89d443536f93f88204c0fd727605313a9d21f..22b6cf1fbf0983c288644219670fe8ea2b7f5d4b 100644
--- a/deploy/package.json
+++ b/deploy/package.json
@@ -35,6 +35,7 @@
   "devDependencies": {
     "chai": "^4.2.0",
     "chai-as-promised": "^7.1.1",
+    "cookie": "^0.4.0",
     "cors": "^2.8.5",
     "dotenv": "^6.2.0",
     "google-spreadsheet": "^3.0.8",
diff --git a/deploy/saneUrl/index.spec.js b/deploy/saneUrl/index.spec.js
index 25056f2a14fa8c0d5973f83a40166489ff6e34ef..cb0038819264714888747130cd1ba5d2029326ed 100644
--- a/deploy/saneUrl/index.spec.js
+++ b/deploy/saneUrl/index.spec.js
@@ -1,4 +1,5 @@
 const sinon = require('sinon')
+const cookie = require('cookie')
 const { Store, NotFoundError } = require('./store')
 
 const userStore = require('../user/store')
@@ -102,6 +103,32 @@ describe('> saneUrl/index.js', () => {
       getStub.restore()
     })
 
+    it('> get on expired with txt html header sets cookie and redirect', async () => {
+
+      const body = {
+        ...payload,
+        expiry: Date.now() - 1e3 * 60
+      }
+      const getStub = sinon
+        .stub(Store.prototype, 'get')
+        .returns(Promise.resolve(JSON.stringify(body)))
+        
+      const { statusCode, headers } = await got(`http://localhost:50000/${name}`, {
+        headers: {
+          'accept': 'text/html'
+        },
+        followRedirect: false
+      })
+      expect(statusCode).to.be.greaterThan(300)
+      expect(statusCode).to.be.lessThan(303)
+
+      expect(getStub.calledWith(name)).to.be.true
+      getStub.restore()
+
+      const c = cookie.parse(...headers['set-cookie'])
+      expect(!!c['iav-error']).to.be.true
+    })
+
     describe('> set', () => {
 
       it('> checks if the name is available', async () => {