Last modified: 2013-07-04 10:35:03 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T47808, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45808 - Parsoid: Redirects should not be served as HTTP 200 with contents of target
Parsoid: Redirects should not be served as HTTP 200 with contents of target
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: C. Scott Ananian
:
: 48271 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-06 22:26 UTC by Juan de Vojníkov
Modified: 2013-07-04 10:35 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Juan de Vojníkov 2013-03-06 22:26:09 UTC
When editing page with redirect, I can edit just the page to where it is redirected.
Comment 1 James Forrester 2013-03-08 16:36:53 UTC
Juan,

Thanks for your bug report; you are correct. This is because Parsoid gives the wrong response for pages with redirects. Pushing over to them.

Current behaviour:
* 200 response with the contents of the target page


On what we'd expect, I'd suggest either type A (but it's messy architecturally) or type B (but not sure about user agent support for HTTP 300):

Expected behaviour - type A:
* when in 'reading mode', a 302 to the page with the redirect;
* when in 'editing mode', a 200 with the contents of the page (to edit the redirect / etc.)

Expected behaviour - type B:
* a 300 response with the first link (for regular browsers) being off to the target of the page, and the second being the ?redirect=no or whatever version to be able to edit it.
Comment 2 C. Scott Ananian 2013-04-17 17:51:34 UTC
If you ask Parsoid for (say) http://localhost:8000/en/OLPC you get the page for "One Laptop Per Child" (the <title> is correct), but the returned page contains {{Redirect|OLPC}} in addition to the text from the "One Laptop Per Child" article.

So in addition to the redirect being transparent, we're also getting bogus extra content in the parsed version.
Comment 3 C. Scott Ananian 2013-04-17 18:02:06 UTC
From IRC discussion w/ GWicke:

gwicke: I think that we should not resolve redirects for top-level requests
gwicke: should return a meta instead that lets the VE edit the redirect
cscott-free: yeah, although editing "#REDIRECT [[foo]]" is a bit awkward, that's an <ol>
gwicke: obviously we'd expose it as <meta property="mw:Redirect" content="foo"> or something like that
cscott-free: i think i learned recently that there can be other 'stuff' in a redirect?
gwicke: arguably this should eventually end up in the head instead of the content
gwicke: but for now we should probably keep it in the content area in the interest of round-tripping
cscott-free: that makes sense.
gwicke: cscott: there can be page content following it that is normally ignored by MW
gwicke: but we should probably still round-trip it
gwicke: hence the idea to keep it inline for now rather than returning a blank body with meta info in the head
(01:58:07 PM) cscott-free: i suspect there should be a corresponding VE bug for editing the <meta property="mw:Redirect" content="foo">
(01:58:08 PM) gwicke: maybe we should use link / rel / href again
(01:58:21 PM) gwicke: for the same relative link resolution reasons

(see bug 45206 comment 5 for a brief discussion of the meta/link issues)
Comment 4 C. Scott Ananian 2013-04-17 18:27:22 UTC
See bug 47328 for the corresponding Visual Editor bug.
Comment 5 Gabriel Wicke 2013-04-17 19:00:11 UTC
See http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Redirects for the preliminary DOM spec.
Comment 6 C. Scott Ananian 2013-04-30 19:34:51 UTC
Note: test "#REDIRECT [[www.google.com]]" which currently does unusual things.
Comment 7 Gabriel Wicke 2013-04-30 19:59:32 UTC
"#REDIRECT [[www.google.com]]" behaves just the same way as "#REDIRECT [[Foo]]", so not that unexpected.
Comment 8 Gerrit Notification Bot 2013-05-01 17:35:50 UTC
Related URL: https://gerrit.wikimedia.org/r/61799 (Gerrit Change I1bd36f32a5e46b90261895e5499a0308875e5e05)
Comment 9 Gabriel Wicke 2013-05-14 21:54:01 UTC
*** Bug 48271 has been marked as a duplicate of this bug. ***
Comment 10 James Forrester 2013-05-17 06:19:40 UTC
As the gerrit commit is merged, can this now be closed?
Comment 11 Gabriel Wicke 2013-05-17 06:21:16 UTC
I have not tested the HTTP responses yet, but am happy to close. Please reopen if you find issues (or open a new bug).
Comment 12 C. Scott Ananian 2013-05-17 07:42:44 UTC
Sorry: the wikitext parsing bit landed but I didn't yet make any changes to how the server handles redirects.  One more patch is needed to change the http status and turn off the old redirect code. Reopening.
Comment 13 Gabriel Wicke 2013-06-12 00:28:23 UTC
I removed our previous behavior of following redirects when encountering a redirect page, so we now return the regular redirect content as expected. Closing as fixed.
Comment 14 Andre Klapper 2013-07-04 10:35:03 UTC
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links