Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support CF headers for metadata #29

Open
acidjazz opened this issue Sep 5, 2024 · 0 comments
Open

support CF headers for metadata #29

acidjazz opened this issue Sep 5, 2024 · 0 comments

Comments

@acidjazz
Copy link
Member

acidjazz commented Sep 5, 2024

Use/detect these headers

export default {
  async fetch(request, env, ctx) {
    const pairs = []
    for (var pair of request.headers.entries()) {
      pairs.push({name: pair[0], value: pair[1]})
    }
    return Response.json(pairs);
  },
};
  {
    "name": "accept",
    "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
  },
  {
    "name": "accept-encoding",
    "value": "gzip, br"
  },
  {
    "name": "accept-language",
    "value": "en-US,en;q=0.9,la;q=0.8,ja;q=0.7"
  },
  {
    "name": "cf-connecting-ip",
    "value": "2605:a601:a0ee:c700:505d:6f74:a4d:65c3"
  },
  {
    "name": "cf-ipcountry",
    "value": "US"
  },
  {
    "name": "cf-ray",
    "value": "8be95a7a5d702cb4"
  },
  {
    "name": "cf-visitor",
    "value": "{\"scheme\":\"https\"}"
  },
  {
    "name": "connection",
    "value": "Keep-Alive"
  },
  {
    "name": "host",
    "value": "bio.acidjazz.workers.dev"
  },
  {
    "name": "priority",
    "value": "u=0, i"
  },
  {
    "name": "sec-ch-ua",
    "value": "\"Chromium\";v=\"128\", \"Not;A=Brand\";v=\"24\", \"Google Chrome\";v=\"128\""
  },
  {
    "name": "sec-ch-ua-mobile",
    "value": "?0"
  },
  {
    "name": "sec-ch-ua-platform",
    "value": "\"macOS\""
  },
  {
    "name": "sec-fetch-dest",
    "value": "document"
  },
  {
    "name": "sec-fetch-mode",
    "value": "navigate"
  },
  {
    "name": "sec-fetch-site",
    "value": "cross-site"
  },
  {
    "name": "sec-fetch-user",
    "value": "?1"
  },
  {
    "name": "upgrade-insecure-requests",
    "value": "1"
  },
  {
    "name": "user-agent",
    "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
  },
  {
    "name": "x-forwarded-proto",
    "value": "https"
  },
  {
    "name": "x-real-ip",
    "value": "2605:a601:a0ee:c700:505d:6f74:a4d:65c3"
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant