~petersanchez

Los Angeles, CA

https://www.petersanchez.com

LA, CA USA - Managua, Nicaragua

~petersanchez/blog-discussion

~petersanchez/public-inbox

View more

Recent activity

Re: [PATCH links] Fixes a bug when a user submits all invalid tags we don't try to do an empty insert. Caused by spammers but a bug none the less. 5 days ago

From Peter Sanchez to ~netlandish/links-dev

Applied.

To git@git.code.netlandish.com:~netlandish/links
   001c767..89e69a6  master -> master

[PATCH links] Fixes a bug when a user submits all invalid tags we don't try to do an empty insert. Caused by spammers but a bug none the less. 5 days ago

From Peter Sanchez to ~netlandish/links-dev

Changelog-fixed: Edge case where all submitted tags are invalid
  resulting in an sql error (empty insert).
---
 models/org_link.go        | 3 +++
 models/tag_link_shorts.go | 3 +++
 models/tag_links.go       | 3 +++
 models/tag_listing.go     | 3 +++
 4 files changed, 12 insertions(+)

diff --git a/models/org_link.go b/models/org_link.go
index 330894c..9e4829e 100644
--- a/models/org_link.go
+++ b/models/org_link.go
@@ -272,6 +272,9 @@ func GetOrgLinksAnalytics(ctx context.Context, opts *database.FilterOptions) ([]
[message trimmed]

[PATCH links] Adding DBI transaction rollback when a domain error occurs. This helps prevernt a hanging process due to transaction leak early in the request cycle. 5 days ago

From Peter Sanchez to ~netlandish/links-dev

Also gobwebs bump.
---
 domain/middleware.go | 17 +++++++++++++++++
 go.mod               | 12 ++++++------
 go.sum               | 12 ++++++++++++
 3 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/domain/middleware.go b/domain/middleware.go
index efe2e84..e60e915 100644
--- a/domain/middleware.go
+++ b/domain/middleware.go
@@ -2,6 +2,7 @@ package domain

import (
[message trimmed]

Re: [PATCH links] Fixing logic typo in last domain redirect change 5 days ago

From Peter Sanchez to ~netlandish/links-dev

Applied.

To git@git.code.netlandish.com:~netlandish/links
   995a0d7..c877de1  master -> master

[PATCH links] Fixing logic typo in last domain redirect change 5 days ago

From Peter Sanchez to ~netlandish/links-dev

---
 domain/middleware.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/domain/middleware.go b/domain/middleware.go
index 261ce4b..efe2e84 100644
--- a/domain/middleware.go
+++ b/domain/middleware.go
@@ -148,7 +148,7 @@ func DomainRedirect(next echo.HandlerFunc) echo.HandlerFunc {
		// Remove :PORT if present
		host := strings.SplitN(mainDomain, ":", 2)[0]
		domain := ForContext(c.Request().Context())
		if strings.EqualFold(domain.LookupName, host) &&
		if !strings.EqualFold(domain.LookupName, host) &&
[message trimmed]

Re: [PATCH links] Fix panic when trying to render an error template. This panic is covering up other errors in edge cases. 5 days ago

From Peter Sanchez to ~netlandish/links-dev

Applied.

To git@git.code.netlandish.com:~netlandish/links
   53069b2..995a0d7  master -> master

[PATCH links] Fix panic when trying to render an error template. This panic is covering up other errors in edge cases. 5 days ago

From Peter Sanchez to ~netlandish/links-dev

Changelog-added: domains.SafeForContext for template handling.
---
 core/templates.go    | 10 ++++++----
 domain/middleware.go |  9 ++++++++-
 models/utils.go      |  4 ++--
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/core/templates.go b/core/templates.go
index 6b7de02..a6e32ea 100644
--- a/core/templates.go
+++ b/core/templates.go
@@ -68,10 +68,12 @@ func AddGlobalTmpl(c echo.Context) gobwebs.Map {
		gmap["settingSection"] = true
	}
[message trimmed]

Re: [PATCH links] Fix bug when invalid UTF8 characters are passed via external site html tags. 12 days ago

From Peter Sanchez to ~netlandish/links-dev

Applied.

To git@git.code.netlandish.com:~netlandish/links
   47cf073..53069b2  master -> master

[PATCH links] Fix bug when invalid UTF8 characters are passed via external site html tags. 12 days ago

From Peter Sanchez to ~netlandish/links-dev

Changelog-fixed: Bug processing invalid UTF8 characters when parsing
  website metadata.
---
 helpers.go | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/helpers.go b/helpers.go
index 431d08a..e086eb2 100644
--- a/helpers.go
+++ b/helpers.go
@@ -326,33 +326,33 @@ func extract(resp io.Reader) *models.HTMLMeta {
			if t.Data == "meta" {
				desc, ok := extractMetaProperty(t, "description")
				if ok {
[message trimmed]