ambiorix-web / ambiorix

🖥️ Web framework for R
http://ambiorix.dev
GNU General Public License v3.0
211 stars 9 forks source link

Content-Type header is overridden by send defaults (doco issue?) #45

Closed MilesMcBain closed 2 years ago

MilesMcBain commented 2 years ago

I found this example in the doco for response headers:

app$get("/hello", \(req, res){
  res$header("Content-Type", "something")
  res$send("Using {ambiorix}!")
})

The problem is that send() has a default for the headers arg: content_html() which will replace the custom Content-Type header something with text/html.

JohnCoene commented 2 years ago

Yes, I just noticed that looking at your previous issue. Pushed a fix.

JohnCoene commented 2 years ago

Closing because this should be fixed in dev, feel free to reopen if it does not suit.