@@ -149,6 +149,7 @@ func TestHandler_Config(t *testing.T) {
149149 requestUrl : "http://foo.api/api/configs/foo/data" ,
150150 test : []try.ResponseCondition {
151151 try .HasStatusCode (http .StatusOK ),
152+ try .HasHeader ("Content-Disposition" , "inline; filename=\" foo.yaml\" " ),
152153 try .HasHeader ("Last-Modified" , "Wed, 27 Dec 2023 13:01:30 GMT" ),
153154 try .HasHeaderXor ("Content-Type" , "text/plain" , "application/yaml" ),
154155 try .HasHeader ("Cache-Control" , "no-cache" ),
@@ -173,6 +174,34 @@ func TestHandler_Config(t *testing.T) {
173174 requestUrl : "http://foo.api/api/configs/foo/data" ,
174175 test : []try.ResponseCondition {
175176 try .HasStatusCode (http .StatusOK ),
177+ try .HasHeader ("Content-Disposition" , "inline; filename=\" foo.json\" " ),
178+ try .HasHeader ("Last-Modified" , "Fri, 22 Dec 2023 13:01:30 GMT" ),
179+ try .HasHeader ("Content-Type" , "application/json" ),
180+ try .HasHeader ("Etag" , etag ),
181+ try .HasHeader ("Cache-Control" , "no-cache" ),
182+ try .HasBody (`{"foo": "bar"}` ),
183+ },
184+ },
185+ {
186+ name : "config data: no extension but ContentType in Info is set" ,
187+ app : func () * runtime.App {
188+
189+ return & runtime.App {Configs : map [string ]* dynamic.Config {
190+ "foo" : {
191+ Info : dynamic.ConfigInfo {
192+ Url : mustUrl ("https://foo.bar/foo" ),
193+ Time : mustTime ("2023-12-22T13:01:30+00:00" ),
194+ Checksum : checksum ,
195+ ContentType : "application/json" ,
196+ },
197+ Raw : data ,
198+ },
199+ }}
200+ },
201+ requestUrl : "http://foo.api/api/configs/foo/data" ,
202+ test : []try.ResponseCondition {
203+ try .HasStatusCode (http .StatusOK ),
204+ try .HasHeader ("Content-Disposition" , "inline; filename=\" foo.json\" " ),
176205 try .HasHeader ("Last-Modified" , "Fri, 22 Dec 2023 13:01:30 GMT" ),
177206 try .HasHeader ("Content-Type" , "application/json" ),
178207 try .HasHeader ("Etag" , etag ),
0 commit comments