如何将内容配置设置为';内联';在GatsbyJS上(在浏览器中显示pdf而不是下载)

如何将内容配置设置为';内联';在GatsbyJS上(在浏览器中显示pdf而不是下载),pdf,gatsby,netlify,content-disposition,Pdf,Gatsby,Netlify,Content Disposition,我用GatsbyJS制作了一个网站,我有一个pdf的链接,我宁愿在浏览器中打开,也不愿下载 我曾尝试在公用文件夹中创建一个_headers文件(hacky,我知道),我也尝试了gatsby plugin netlify在gatsby-config.js中设置头,但我不确定如何准确地编写它。下面代码的最后三行当然是错误的 plugins: [ { resolve: `gatsby-plugin-netlify`, options: { headers

我用GatsbyJS制作了一个网站,我有一个pdf的链接,我宁愿在浏览器中打开,也不愿下载

我曾尝试在公用文件夹中创建一个_headers文件(hacky,我知道),我也尝试了gatsby plugin netlify在gatsby-config.js中设置头,但我不确定如何准确地编写它。下面代码的最后三行当然是错误的

plugins: [
    {
      resolve: `gatsby-plugin-netlify`,
      options: {
        headers: {}, // option to add more headers. `Link` headers are transformed by the below criteria
        allPageHeaders: [], // option to add headers for all pages. `Link` headers are transformed by the below criteria
        mergeSecurityHeaders: true, // boolean to turn off the default security headers
        mergeLinkHeaders: true, // boolean to turn off the default gatsby js headers
        mergeCachingHeaders: true, // boolean to turn off the default caching headers
        transformHeaders: (headers, path) => headers, // optional transform for manipulating headers under each path (e.g.sorting), etc.
        generateMatchPathRewrites: true, // boolean to turn off automatic creation of redirect rules for client only paths
        Content-Disposition: inline
        Content-Disposition: attachment
        Content-Disposition: attachment; filename="melbournewalks.pdf"
      },
    },
  ],