{"action":"created","issue":{"url":"https://api.github.com/repos/seanmonstar/warp/issues/122","repository_url":"https://api.github.com/repos/seanmonstar/warp","labels_url":"https://api.github.com/repos/seanmonstar/warp/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/seanmonstar/warp/issues/122/comments","events_url":"https://api.github.com/repos/seanmonstar/warp/issues/122/events","html_url":"https://github.com/seanmonstar/warp/issues/122","id":373208273,"node_id":"MDU6SXNzdWUzNzMyMDgyNzM=","number":122,"title":"Restrictions on custom filters and route-guards","user":{"login":"cynecx","id":5961244,"node_id":"MDQ6VXNlcjU5NjEyNDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5961244?v=4","gravatar_id":"","url":"https://api.github.com/users/cynecx","html_url":"https://github.com/cynecx","followers_url":"https://api.github.com/users/cynecx/followers","following_url":"https://api.github.com/users/cynecx/following{/other_user}","gists_url":"https://api.github.com/users/cynecx/gists{/gist_id}","starred_url":"https://api.github.com/users/cynecx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cynecx/subscriptions","organizations_url":"https://api.github.com/users/cynecx/orgs","repos_url":"https://api.github.com/users/cynecx/repos","events_url":"https://api.github.com/users/cynecx/events{/privacy}","received_events_url":"https://api.github.com/users/cynecx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-23T21:24:25Z","updated_at":"2018-10-24T00:48:33Z","closed_at":"2018-10-24T00:48:33Z","author_association":"NONE","body":"I am currently trying to implement a simple route guard which restricts a specific path based on a header value. But I am not sure if this is possible right now with the restrictions around the api (Filter/FilterBase/unit?).\r\n\r\nWhat I am basically trying to implement is a more dynamic version of `warp::filters::header::exact` since both params have static lifetime.\r\n\r\n```rust\r\nlet hostname = warp::header::header::<String>(\"Host\")\r\n        .and_then(move |hostname| {\r\n            if hostname == ctx_cln.hostname {\r\n                Ok(())\r\n            } else {\r\n                Err(warp::reject())\r\n            }\r\n        })\r\n        .and(docs);\r\n```\r\n\r\nBut then we have the issue that the `Extract` type is something like `((), std::string::String)` and therefore does not implement `ReplySealed`.\r\n\r\nHowever, it seems that the workaround for that is the `unit` method, which is not public currently (And since `FilterBase` is also private, I see no way to actually achieve this at the current state).\r\n\r\nhttps://github.com/seanmonstar/warp/blob/8f5213e3f17758d873cdf865107eca241da8156a/src/filters/body.rs#L50-L65"},"comment":{"url":"https://api.github.com/repos/seanmonstar/warp/issues/comments/432472270","html_url":"https://github.com/seanmonstar/warp/issues/122#issuecomment-432472270","issue_url":"https://api.github.com/repos/seanmonstar/warp/issues/122","id":432472270,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjQ3MjI3MA==","user":{"login":"cynecx","id":5961244,"node_id":"MDQ6VXNlcjU5NjEyNDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5961244?v=4","gravatar_id":"","url":"https://api.github.com/users/cynecx","html_url":"https://github.com/cynecx","followers_url":"https://api.github.com/users/cynecx/followers","following_url":"https://api.github.com/users/cynecx/following{/other_user}","gists_url":"https://api.github.com/users/cynecx/gists{/gist_id}","starred_url":"https://api.github.com/users/cynecx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cynecx/subscriptions","organizations_url":"https://api.github.com/users/cynecx/orgs","repos_url":"https://api.github.com/users/cynecx/repos","events_url":"https://api.github.com/users/cynecx/events{/privacy}","received_events_url":"https://api.github.com/users/cynecx/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T00:48:33Z","updated_at":"2018-10-24T00:48:33Z","author_association":"NONE","body":"@seanmonstar Oh yes, I haven't thought of that :D. I guess that should do as a temporary solution. Thank you!"}}
{"actor":{"display_login":"cynecx"}}