Skip to content

Conversation

@nikitacano
Copy link
Contributor

Summary

Add example to Snippets gallery that shows how to modify the fetch request to follow redirects from the origin, ensuring the client receives the final response.

@nikitacano nikitacano requested review from a team and pedrosousa as code owners December 3, 2024 11:29
@nikitacano nikitacano changed the title Snippets follow redirects [Rules] Snippets example to follow redirects from origin Dec 3, 2024
Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 1 total issue(s) found.

This template is ready for use and should fit most redirect-following scenarios.

It ensures the Snippet transparently follows redirects issued by the origin server.
The `fetch()` API’s `redirect: "follow"` option ensures automatic handling of `3xx` redirects, returning the final response. If the origin response is not a redirect, the original content is returned.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `fetch()` APIs `redirect: "follow"` option ensures automatic handling of `3xx` redirects, returning the final response. If the origin response is not a redirect, the original content is returned.
The `fetch()` API's `redirect: "follow"` option ensures automatic handling of `3xx` redirects, returning the final response. If the origin response is not a redirect, the original content is returned.

Issues:

  • Style Guide - (cloudflare.NonStandardQuotes-warning) Use standard single quotes or double quotes only. Do not use any of the following quote mark types: ‘ ’ “ ”. In the text, we found this character: ’

Fix Explanation:

The issue identified is the use of a non-standard curly apostrophe ’ in the word "API’s". This should be replaced with a standard single quote ' to comply with the style guide. The rest of the text is correct, including the use of back-tick marks and double quotes around "follow".

@nikitacano nikitacano force-pushed the snippets-follow-redirects branch from 6200dd6 to a0ce968 Compare December 3, 2024 11:30
@github-actions github-actions bot added size/s product:rules Related to rules labels Dec 3, 2024
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 3, 2024

Deploying cloudflare-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 459ea4f
Status: ✅  Deploy successful!
Preview URL: https://7963c243.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://snippets-follow-redirects.cloudflare-docs-7ou.pages.dev

View logs

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2024

@pedrosousa pedrosousa merged commit a65a29a into production Dec 3, 2024
12 checks passed
@pedrosousa pedrosousa deleted the snippets-follow-redirects branch December 3, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:rules Related to rules size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants