This page provides code samples that address some common use cases for plugins.
For more Rust, Go, and C++ plugin samples, see the Service Extensions GitHub repository for plugins.
The plugins feature is in Preview for Media CDN.
Add HTTP request and response headers
The following code samples show how to add HTTP request headers.
C++
Go
Rust
The following code samples show how to add HTTP response headers.
C++
Go
Rust
Rewrite the request URL
The following code samples show how to rewrite the request URL by using regular expressions. The following code samples remove part of the path, but any URI mutation, such as path, query, or fragment, is feasible.
These samples also show best practices around regular expressions, namely using linear-time regular expression libraries and compiling the expressions at plugin initialization time.