From 36609a7cbb8aea9850396f16ab3eef2881c5ea7e Mon Sep 17 00:00:00 2001 From: Klaus Frank Date: Thu, 13 Aug 2020 18:29:19 +0200 Subject: [PATCH] Caching proxy fix #35 Always bypass cache Fix #35 --- module/Public/Invoke-nbApi.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/Public/Invoke-nbApi.ps1 b/module/Public/Invoke-nbApi.ps1 index fc71447..0992d1c 100644 --- a/module/Public/Invoke-nbApi.ps1 +++ b/module/Public/Invoke-nbApi.ps1 @@ -130,6 +130,11 @@ function Invoke-nbApi { $Params['Headers'] = @{ Authorization = "token {0}" -f $marshal::PtrToStringUni($unmanagedString) } + if ($HttpVerb -eq "GET") { + $PArams['Headers']['X-Cache-Purge'] = 'true' + $PArams['Headers']['Cache-Control'] = 'no-store' + $PArams['Headers']['Pragma'] = 'no-cache' + } } #splat the paramaters into Invoke-Restmethod $Response = Invoke-RestMethod @Params