@@ -118,10 +118,10 @@ pub struct VercelProxy {
118118 pub path : String ,
119119 /// User agent strings of the request.
120120 pub user_agent : Vec < String > ,
121- /// Referer of the request.
122- pub referer : String ,
123121 /// Region where the request is processed.
124122 pub region : String ,
123+ /// Referer of the request.
124+ pub referer : Option < String > ,
125125 /// HTTP status code of the proxy request.
126126 pub status_code : Option < i64 > ,
127127 /// Client IP address.
@@ -282,13 +282,13 @@ pub fn vercel_log_to_sentry_log(vercel_log: VercelLog) -> OurLog {
282282 add_attribute ! ( "vercel.proxy.method" , method) ;
283283 add_attribute ! ( "vercel.proxy.host" , host) ;
284284 add_attribute ! ( "vercel.proxy.path" , path) ;
285- add_attribute ! ( "vercel.proxy.referer" , referer) ;
286285 add_attribute ! ( "vercel.proxy.region" , region) ;
287286
288287 if let Ok ( user_agent_string) = serde_json:: to_string ( & user_agent) {
289288 attributes. insert ( "vercel.proxy.user_agent" , user_agent_string) ;
290289 }
291290
291+ add_optional_attribute ! ( "vercel.proxy.referer" , referer) ;
292292 add_optional_attribute ! ( "vercel.proxy.status_code" , status_code) ;
293293 add_optional_attribute ! ( "vercel.proxy.client_ip" , client_ip) ;
294294 add_optional_attribute ! ( "vercel.proxy.scheme" , scheme) ;
@@ -363,8 +363,8 @@ mod tests {
363363 host : "my-app.vercel.app" . to_owned ( ) ,
364364 path : "/api/users?page=1" . to_owned ( ) ,
365365 user_agent : vec ! [ "Mozilla/5.0..." . to_owned( ) ] ,
366- referer : "https://my-app.vercel.app" . to_owned ( ) ,
367366 region : "sfo1" . to_owned ( ) ,
367+ referer : Some ( "https://my-app.vercel.app" . to_owned ( ) ) ,
368368 status_code : Some ( 200 ) ,
369369 client_ip : Some ( "120.75.16.101" . to_owned ( ) ) ,
370370 scheme : Some ( "https" . to_owned ( ) ) ,
0 commit comments