Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add content negotiation filter #1052

Merged
merged 3 commits into from
Sep 25, 2018
Merged

Conversation

Pchelolo
Copy link
Contributor

@Pchelolo Pchelolo commented Aug 23, 2018

Implements the protocol we've all agreed on in https://phabricator.wikimedia.org/T128040#4528109

Now we're supplying dummy data-parsoid to Parsoid to bypass validation, but @arlolra promised to fix that in Parsoid.

cc @wikimedia/services @wikimedia/parsing

@Pchelolo Pchelolo requested review from d00rman and jdforrester and removed request for jdforrester August 24, 2018 21:40
@Pchelolo Pchelolo changed the title WIP: Add content negotiation filter Add content negotiation filter Sep 13, 2018
Change-Id: Iaa3bcee0b2f6b5b59b8b8716e861e76fc405137f
Change-Id: I8d6e0bc299ff2aeeb3e0e3d218fe766a2bbeefff
Change-Id: I9ebbeab5bc3e2180b59f9a13f735a39171b20a63
@Pchelolo
Copy link
Contributor Author

This is completely completed, was tested in Vagrant and seems to work OK. Next step is merging it and deploying to Labs to test VE some more. After - coordinated deploy together with @wikimedia/parsing as it's the first time we do anything like this and a lot of caution is needed.

@d00rman d00rman merged commit 540e979 into wikimedia:master Sep 25, 2018
return htmlRes;
}

if (semver.satisfies(storedVersion, requestedVersion)) {
Copy link
Member

Choose a reason for hiding this comment

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

This might be clearer as eq since the requestedVersion isn't a range.

But maybe you meant to use a partial or x-range (to ignore the patch)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We ignore the patch both in Varnish (by basically resetting the patch to 0) and in RESTBase

Copy link
Member

Choose a reason for hiding this comment

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

You're saying that storedVersion will also always have a sanitized patch level? In which case, use eq. If not, you probably want to express requestVersion as a range using partial or x-range.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right.. will make another pr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants