Граф коммитов

1541 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Amsterdam 71ca2575a1 internal/fetch/internal/doc: remove unused code
Change-Id: I50918f4d9984c6d01649cc5674d9e35af360d0d9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242857
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-21 12:38:10 +00:00
Jonathan Amsterdam 57c5aa6ebf internal/dochtml: use safehtml throughout
Convert almost all of the remainder of the dochtml package to use
safehtml. (There is still a case with comments that needs to be
dealt with.)

This requires using legacy conversions to generate
safehtml.Identifiers from Go symbols and dotted expressions,
since they contain characters that are not permitted in safehtml.Identifiers.

I filed https://github.com/google/safehtml/issues/4 and
https://github.com/google/safehtml/issues/5 to get those characters
allowed.

Change-Id: Ic1b821680a6cb5dfae445a87cd305ae02cd78493
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242818
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-21 12:38:01 +00:00
Jonathan Amsterdam ab821ecd42 content/static/html: remove bad JS
There was an attempt to create a noscript tag, which only runs when JS
is disabled, using JS.

Remove it.

For golang/go#40321.

Change-Id: I99c02810ed7c299fb606259823ef9b764c525bb6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243858
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-21 12:35:55 +00:00
Jonathan Amsterdam 23fc355e37 internal/frontend: handle img src attributes with surrounding whitespace
Following the HTML spec at
https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-src,
it is OK to have spaces around an img src attribute. Trim them before
escaping.

Change-Id: I07e57a18cfc342ba2f8c24ba99fd92f838975222
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243859
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-21 12:35:38 +00:00
Jonathan Amsterdam 789ff0b13c internal/fetch/dochtml: use safehtml to format doc lines
Change Renderer.formatLineHTML to use safehtml throughout.

Change-Id: I51f20b926fea0ed50eba5dd94cae64989a9c666e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242577
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-20 22:54:23 +00:00
Jonathan Amsterdam 37b6929015 internal/fetch/dochtml: render decls safely
Modify the Renderer.declHTML method to use safehtml.

Do this by collecting safehtml.HTML fragments as the ast.Decl
is scanned, then concatenating them together.

Change-Id: Ibe45084e9e9e4015af4c4d76e21d0f255e7502c9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242497
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-20 22:54:17 +00:00
Julie Qiu fbdbaf6b69 internal/frontend: fix TestReadmeHTML/valid_markdown_readme_with_CRLF
TestReadmeHTML/valid_markdown_readme_with_CRLF was introduced in
CL 243457 and doesn't pass. The test is fixed.

Change-Id: Ia9d12e408d9574f2cb15c3f88f82e7a309ed5b52
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243701
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-07-20 22:25:28 +00:00
Andy Bursavich 9dd2dba440 internal/middleware: fix experiment assignment precision and stability
Increases rollout precision to accommodate all integers in the
range [0,100].

Assigns each user a stable rollout threshold above which they are
added to and remain in the experiment, instead of being shuffled
in and out as the rollout progresses.

Fixes golang/go#40314

Change-Id: Id1c520fe1e1659f32cc3bcc254b6729ed77309f1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243659
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-20 20:27:46 +00:00
Anze Kolar 6bba22c162 internal/frontend: replace \r\n with \n in readmes and licences
Replace CRLF line terminators in readme and license files before
rendering Overview and Licenses tabs on the Details page. Keeping \r
characters interferes with blackfriday's parser, resulting in an
incorrectly rendered HTML output (see golang/go#40203 for details).

Fixes golang/go#40203.

Change-Id: Id6c2951c9f23e7054957071cf1c33fd3fa6494c6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243457
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-20 20:25:16 +00:00
Julie Qiu 8cba941bd3 internal/middleware: update quota server to check AuthHeader and AcceptedAuthValues
The quota server now checks for authentication using a known
header, to see if requests from the source should be rate-limited.

This replaces an existing implementation, where the quota server checked
for the "Referer", since this is header is usually not set by requests
that do not originate from a browser.

This functionality is used to allow the teeproxy to forward requests to
pkg.go.dev.

Change-Id: Ic1eac95c3047219842b561f2cee3b0547fe36c5c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243283
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-20 19:47:22 +00:00
Julie Qiu e28af9a0fe content: update search page for no results
When there are no results, the search page now provides instructions on
how to use the frontend fetch feature when that experiment is on.

For golang/go#37002

Change-Id: I28939ca0a871defb42c43bbce3dae14b657c75c1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242922
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-20 19:29:04 +00:00
Julie Qiu 50e50040f9 internal/frontend: poll the database for frontend fetch results less frequently
pollEvery is increased to every second instead of every 500ms, since
most fetch requests took longer than 500ms to finish when testing
locally.

For golang/go#37002

Change-Id: I6d0e77153872a6303cd60df68419adb8821dcebe
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242923
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-20 19:28:23 +00:00
Julie Qiu 3d14dbdc5a internal/frontend: update response text for fetch endpoint
The response text for statuses http.StatusSeeOther and
http.StatusNotFound is updated to use smart quotes and specify the
requested version.

TODOs in internal/frontend/fetch.go are also updated.

For golang/go#37002

Change-Id: I274847ca979e47dc5d9e98456d84e8511332a811
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242921
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-20 19:28:15 +00:00
Julie Qiu 0992fa1157 internal/middleware: delete cacheBypassHeader
The cacheBypassHeader header is deleted, since it isn't being used
for anything at the moment.

In the future, if we need to bypass the cache, we should use
the AuthHeader system currently used by the quota server, to determine
if a request can bypass the quota server rate-limit checks.

Change-Id: I82430df382645f93dfb433c58c5b6e014021174f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243648
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-20 18:59:36 +00:00
Julie Qiu 483e751950 migrations: drop default in 000023
The DEFAULT isn't needed, since go_mod_path will be populated. The
syntax was also incorrect, since a column cannot both be nullable
and have a default value.

Change-Id: Idec4d1977eb070cbad13e0cc2485d7c9d804aed6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243649
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-20 18:57:03 +00:00
Julie Qiu 48a724031d migrations: set not-null constraint on version_map.go_mod_path
version_map.go_mod_path should always be set. In events when it is
unknown (such as for status 40x requests), it will be set to the empty
string. A not-null constraint is now set on this column.

For golang/go#36811
For golang/go#37002

Change-Id: I9c5e01fbe9d772cb4cb7e43394aac2564a494734
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242437
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-20 18:40:31 +00:00
Julie Qiu 8760a943e8 internal: reprocess modules with DBModuleInsertInvalid status
When we reprocess modules, ones with a status DBModuleInsertInvalid will
now be reprocessed.

Additionally, it is now possible to reprocess modules based on a
specific status code using the /reprocess endpoint.

Change-Id: I378d635ec3939717ee2c8305db7944c6467b28d3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243277
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-20 14:37:55 +00:00
Jonathan Amsterdam 9a20eadf10 internal/fetch/dochtml: use safehtml for Go symbol identifiers
Go symbols are used as HTML ids in span elements to allow linking to
the doc for a symbol with a fragment. Use safehtml.Identifiers for
these IDs.

Change-Id: I872b3edacf6ce053ed008dd570e92574f9189074
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242297
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-20 14:18:16 +00:00
Jonathan Amsterdam 5dab955ef2 internal/frontend: clean up TestReadmeHTML
No longer require the exact trailing space.

Change-Id: I6f93fd57cf7e8a32cc43cabe618ccc3ce024b81c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243619
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-20 14:18:00 +00:00
Jonathan Amsterdam 5bdfc28e08 internal/frontend: use escaped path when modifying image sources
When walking HTML inside markdown to translate relative image sources,
use the escaped path of the source rather than the original path.

Previously, if the value of an img src tag was escaped, like

    a%20b

it was being converted to

    a b

The sanitizer then removed the entire img tag.

Using URL.EscapedPath preserves the original escaping.

Change-Id: I05544a7f2d089c7026dedac605e07b193823957b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243618
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-20 14:17:37 +00:00
Jonathan Amsterdam 977cf9335e internal/frontend: factor out common test value
In TestReadmeHTML, move repeated ModuleInfo to a local variable.

Change-Id: Ib866715686aa4f144d21d41a7210ae65e7c5ef08
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243617
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-20 14:17:31 +00:00
Julie Qiu c9de00e355 cmd/worker: fix staticPath is unused error
Fix staticcheck error:
cmd/worker/main.go:43:2: var staticPath is unused (U1000)

Change-Id: Idde48f7ab29bd0fd0b54d032d404724b8a9b78c1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243279
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-17 21:10:21 +00:00
Jonathan Amsterdam cb17e53bcd internal/frontend: improvements to translateHTML
- Walk all the children of the body node, not just the first: there
  may be more than one.

- Fail if the top-level node is not what we expect, rather than
  returning something.

Change-Id: I2c479064dbe45a9bbd402f3878ab4638d62dd475
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243224
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-17 21:07:46 +00:00
Julie Qiu e933d510e2 internal/middleware: downgrade redis error to info
Change-Id: Ia2034ea85b21d97398e105476de271d8a23e2635
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243278
Reviewed-by: Robert Findley <rfindley@google.com>
2020-07-17 19:06:47 +00:00
Jonathan Amsterdam 186838c492 internal/source: use better github raw template
Replace the previous github template for raw data
(raw.githubusercontent...)  with a new one that is more uniform (the
same as the blob template, with "raw" instead of "blob").

The main advantage is that we can drop the "repoPath" parameter to the
template, which was necessary only to support the unusual GitHub
URLs.

Now that GitHub and GitLab templates are identical, we can drop the
GitLab ones. We preserve "gitlab" in the map from kinds to templates
so we can continue to unmarshal DB modules.source_info columns
that use "gitlab".

Change-Id: Id3d45929f0eb2c040109449d4208279cca44f079
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243217
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-17 13:38:46 +00:00
Jonathan Amsterdam cd77657e37 internal/frontend: don't regenerate HTML unless it changed
While walking HTML, keep track of whether we made any changes.
If not, return the original HTML, not the re-rendered version.

This minimizes changes to existing readmes (since parsing HTML and
then rendering it does not always give you back the same thing).

Change-Id: Id43c1d45359d44fffd0ab9e6b655fad12262ede7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242980
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-17 13:38:14 +00:00
Jonathan Amsterdam c587389cc5 internal/frontend: export ReadmeHTML
Export the ReadmeHTML function to enable testing by code outside the
package.

Specifically, we'll be writing a program to test HTML changes against
the database.

Change-Id: I21dbd2606e1c370c974e9bf65d2535860884435b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242979
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-16 15:44:29 +00:00
Jonathan Amsterdam ec5c5861be internal/frontend: add a test case for bad SourceInfo
Confirm that attacks that exploit bad URLs are thwarted.

Change-Id: I079f81e0b3f6777fa6d271c4e43fccf7a0c6b438
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242978
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-16 15:44:11 +00:00
Jonathan Amsterdam 1e106a2018 internal/frontend: translateRelativeLink takes source.Info instead of ModuleInfo
Change the arg to translateRelativeLink and friends to be a source.Info, since
it doesn't need a full ModuleInfo.

Change-Id: Iae92f39328c5f207c4f28ea5ba8cd4c2ca38392f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242977
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-16 15:43:50 +00:00
Miguel Acero 336678d72e internal: fix experiment variable for executable examples
The experiment variable for executable examples was describing the
description of the variable rather than the name constant. This CL
changes it to the name constant.

For golang/go#36865

Change-Id: I84c3fcf8147c2c3964c262037ff2340f2ca0f39a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243037
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-16 15:17:05 +00:00
Julie Qiu 1db105fbc5 internal/derrors: rename httpCodes to codes
httpCodes is renamed to codes, since several codes are not HTTP status
codes.

Change-Id: I1d0adb0e4fa26c9eb88d1fdae83fa22939de242a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242884
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-16 14:19:18 +00:00
Julie Qiu 1ffd7abdbd internal/derrors: rename FromHTTPStatus to FromStatus
FromHTTPStatus is renamed to FromStatus, since several derrors codes are
not HTTP status codes.

Change-Id: I36aec502e4de2bfb900dda95a985a0fcdb3bface
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242883
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-16 14:19:14 +00:00
Julie Qiu bf169b2ac3 internal/derrors: rename ToHTTPStatus to ToStatus
ToHTTPStatus is renamed to ToStatus, since several derrors codes are
not HTTP status codes.

Change-Id: I41bf1452fdbbafe1a4f752bc3092e39515a2db4b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242882
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-16 14:19:09 +00:00
Julie Qiu 606e69c6ed internal/frontend: use GetLicenses
GetLicenses is now used by the frontend to fetch license data when the
"use-directories" experiment is on.

For golang/go#39629

Change-Id: I7a4c358b9e4f0d0089c301a40703becda1d5514d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242778
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-16 14:18:56 +00:00
Jonathan Amsterdam 9243538999 internal/worker: use safehtml
Use safehtml/template instead of html/template to render the status
page.

Change-Id: I213592acb087c2e578c9d4ed42572ea3a0949725
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242918
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-16 14:16:05 +00:00
Miguel Acero 3b2279f1f1 internal/fetch/dochtml: modify render function to use *doc.Example
This commit modifies the codeHTML function to use *doc.Example
instead of a *doc.Example.Code so that we can have access to
*doc.Example.Play whenever the example is executable. This is important so that the imports are visible in the
example documentation. If the example doesn't include a executable editor,
it will default to rendering *doc.Example.Code. Also, this commit modifies the HTML template
to include a play button for the playground integration, which will be
displayed once all of the play button functionality is incorporated.
This commit also adds an experiment flag to enable the feature by
passing in context to the render function

For golang/go#36865

Change-Id: If2ef0d128fdd791617aad5dd8eb8a08c90e9ae72
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/240685
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-16 13:41:34 +00:00
shaquilleq 90dccfe9e1 internal/fetch/internal/doc: parse package name with major version
simpleImporter currently parses package names by taking the last path
component of the package path, even if the last component is the major
version. This fix ignores the version and allows simpleImporter to
return the correct name.

Fixes golang/go#38613

Change-Id: I393db8393e5341bfe13350068f064bfe9bfc0b37
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241128
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-16 05:15:57 +00:00
shaquilleq 522d9c7fad internal/teeproxy: use environment variable to specify forwarding hosts
The teeproxy currently allows forwarding to a host specified in each
request coming from godoc.org. Use environment variables instead to
specify the target host/s for each request.

Also add a new tag to aggregate metrics by host.

Change-Id: Ifcba0f227375801f7dd154d736a84583bbbdd827
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242097
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-15 22:41:11 +00:00
Julie Qiu e07f6dde7c internal/postgres: add support for stdlib
GetLicenses currently does not handle the std module or packages in the
stdlib. Support is added for those paths.

For golang/go#39629

Change-Id: I8e41cec7004111608c712b5d34f2ad07aede15b6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242777
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-15 21:04:04 +00:00
Julie Qiu d5ae09ca58 internal/frontend: rearrange functions in tabs.go
The functions in tab.go are rearranged so that ones with the "legacy"
prefix are moved to the bottom of the file.

For golang/go#39629

Change-Id: Ia0b1229e67eadc3dc7d26a8f4a02eab458e7de6b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242581
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-15 21:03:58 +00:00
Julie Qiu 784e1b734f internal/frontend: add legacy prefix to fetch*VersionDetails
The "legacy" prefix is added to fetchPackageVersionDetails and
fetchModuleVersionDetails, since these will be replaced with a
fetchVersionDetails function that reads from the paths table.

For golang/go#39629

Change-Id: I059a26cb5998b831e9be725a055ac1ce9692fee4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242580
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-15 21:03:17 +00:00
Miguel Acero 6ffa811e8a doc: update precommit.md
This change removes internal information about Google workstations from documentation.

Change-Id: I9284ee56d6fe2364b36e4146a16bfca50e7fc90a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242779
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-15 20:28:36 +00:00
Jamal Carvalho 66d7d7c20c content/static: fix badge dynamic update
After a badge is created when a user makes changes to the url
input field, the urls will dynamically update with JS enabled.
This change fixes the dynamically updated URLs.

Fixes golang/go#40216

Change-Id: I6a484d3daf7e7e6b09b8a110339b505031b8fada
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242737
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-15 14:59:53 +00:00
Amarjeet Anand f7303dcc15 internal: add GetLicenses by path
This change introduces a new method on the DataSource interface,
GetLicenses, which returns the licenses that apply for a given path,
module path, and resolved version combination.
A license in the current or any parent directory of the specified path
applies to it.

Fixes golang/go#40027

Change-Id: If91429ac12880ac3b6254bf0acd7d3ac983c93e7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241718
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-15 04:05:21 +00:00
Daniel Martí 130a4e343b content: clarify that "expand example" is clickable
Examples are collapsed by default, and if one clicks on the header, they
are expanded.

However, that's not terribly obvious to a new user, since the cursor
when hovering over those collapsed example headers is the default for a
text element, the "text selection" cursor.

Fix that, keeping the list sorted.

Change-Id: Idfb7baae1dfc3ae3b6800d58e0d95de49eabf1b7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241017
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-14 21:43:33 +00:00
Jamal Carvalho 2f4e4a8df3 content,internal: fix markdown badge snippet
This change fixes the urls for the markdown snippet
on the badge generation tool. The image and documentation
urls were switched.

Fixes golang/go#40216

Change-Id: I8bfa409019f00c79116875da1ee9755b2238250e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242641
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-14 20:51:22 +00:00
Julie Qiu b8b500a9e2 internal/frontend: fix TestFetchPathAlreadyExists/491
Fixes TestFetchPathAlreadyExists/491, which was broken in CL 242458.

Change-Id: I9877a971f24874f3772dc057c978bea6d9d8bde8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242640
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-14 20:11:54 +00:00
Anze Kolar 4646ba4372 internal/frontend: fix redirects for shortcuts with trailing slashes
Opening /http/ on pkg.go.dev is considered a shortcut to
pkg.go.dev/net/http and should redirect there. However, http.Redirect()
creates a URL relative to the current URL (/http/) and redirects to
pkg.go.dev/http/net/http instead.

In this CL, relative redirect paths are replaced by absolute paths so
that /http/ redirects to /net/http.

Fixes golang/go#40166.

Change-Id: Ic3b9e6da59bfa2358b7f75e565b8a52662f17eb8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242138
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-14 19:54:49 +00:00
Julie Qiu 47787dc2f0 content,README.md: use golang.org/s/pkgsite-feedback
The canonical feedback link is changed to golang.org/s/pkgsite-feedback,
instead of golang.org/s/discovery-feedback, for consistency with the
project name. Both links will continue to work and redirect to the same
location.

Change-Id: I73fe7018c9d9935dcc584c4f90a82f6c07633787
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242557
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-14 19:48:04 +00:00
Julie Qiu 272856c885 internal/frontend: return 303 for alternative modules
Status 303 is now returned for alternative modules, since 491 isn't an
actual HTTP code.

The response text for cases where we find a module but not the fullPath
is updated.

For golang/go#36811
For golang/go#37002

Change-Id: I68ca2278e4bd32c4e867d86179243419d56903bd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242458
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-14 19:07:22 +00:00