◐ Shell
clean mode source ↗

Referrer-Policy Header by gsquire · Pull Request #920 · hyperium/hyper

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@gsquire

Instead of parsing one value in the ReferrerPolicy struct, allow for a list and use the last value. I believe this is what the ticket mentions, but I could have misinterpreted.

Closes #882

@seanmonstar

@jdm

This isn't quite right - this still only looks at the very last comma-separated values and ignores the others. We want to return the rightmost value that is successfully recognized - this implies that we either need to iterate left to right and track the most recent successful parse, or iterate right to left and return the first value that is successful.

@gsquire

Ah I see.

I think the ideal way to do that would be to scan right to left checking the value each time and returning the first valid one. I will make that change. Thanks for your input.

@seanmonstar

@gsquire it would also help here to include a test in this module of this behavior

@gsquire

I don't think my solution is elegant so I am open to suggestions on improving it.

I also rebased onto master.

@gsquire

I refactored the ugly flow I had before. It should be good to go now.

@jdm

@seanmonstar