Skip to content

Commit

Permalink
Switch to Nominatim for reverse geocoding
Browse files Browse the repository at this point in the history
  • Loading branch information
jlelse committed Nov 11, 2024
1 parent 4b5d143 commit 1c3c46c
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 73 deletions.
2 changes: 1 addition & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type goBlog struct {
// Errors
errorCheckMediaTypes []ct.MediaType
// Geo
photonGroup singleflightx.Group[string, *geojson.FeatureCollection]
nominatimGroup singleflightx.Group[string, *geojson.FeatureCollection]
// Hooks
pPostHooks []postHookFunc
pUpdateHooks []postHookFunc
Expand Down
1 change: 1 addition & 0 deletions dbmigrations/00037.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete from persistent_cache where key like 'photon-%';
94 changes: 60 additions & 34 deletions geo.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,90 @@ import (
"embed"
"encoding/json"
"fmt"
"slices"
"strings"
"time"

gogeouri "git.jlel.se/jlelse/go-geouri"
"github.com/carlmjohnson/requests"
geojson "github.com/paulmach/go.geojson"
"github.com/samber/lo"
"go.goblog.app/app/pkgs/bufferpool"
)

func (a *goBlog) geoTitle(g *gogeouri.Geo, lang string) string {
if name, ok := g.Parameters["name"]; ok && len(name) > 0 && name[0] != "" {
return name[0]
}
fc, err := a.photonReverse(g.Latitude, g.Longitude, lang)
if err != nil || len(fc.Features) < 1 {
return fmt.Sprintf("%.4f, %.4f", g.Latitude, g.Longitude)
fallbackTitle := fmt.Sprintf("%.4f, %.4f", g.Latitude, g.Longitude)
fc, err := a.nominatimReverse(g.Latitude, g.Longitude, lang)
if err != nil || len(fc.Features) == 0 {
return fallbackTitle
}
f := fc.Features[0]
return strings.Join(lo.Filter([]string{
f.PropertyMustString("city", ""), f.PropertyMustString("state", ""), f.PropertyMustString("country", ""),
}, func(s string, _ int) bool { return s != "" }), ", ")
feature := fc.Features[0]
address, ok := feature.Properties["address"].(map[string]interface{})
if !ok {
return fallbackTitle
}
getFirstNonEmpty := func(keys ...string) string {
for _, key := range keys {
if value, ok := address[key].(string); ok && value != "" {
return value
}
}
return ""
}
titleParts := []string{
getFirstNonEmpty("suburb", "neighborhood", "hamlet"),
getFirstNonEmpty("village", "town", "city"),
getFirstNonEmpty("state", "county"),
getFirstNonEmpty("country"),
}
var nonEmptyParts []string
for _, part := range titleParts {
if part != "" {
nonEmptyParts = append(nonEmptyParts, part)
}
}
if title := strings.Join(nonEmptyParts, ", "); title != "" {
return title
}
return fallbackTitle
}

func (a *goBlog) photonReverse(lat, lon float64, lang string) (*geojson.FeatureCollection, error) {
key := fmt.Sprintf("photon-%v-%v-%v", lat, lon, lang)
fc, err, _ := a.photonGroup.Do(key, func() (*geojson.FeatureCollection, error) {
// Create feature collection
fc := geojson.NewFeatureCollection()
func (a *goBlog) nominatimReverse(lat, lon float64, lang string) (*geojson.FeatureCollection, error) {
key := fmt.Sprintf("nominatim-%v-%v-%v", lat, lon, lang)
fc, err, _ := a.nominatimGroup.Do(key, func() (*geojson.FeatureCollection, error) {
// Check cache
var cached []byte
if cache, _ := a.db.retrievePersistentCache(key); cache != nil {
// Cache hit, unmarshal and return
if err := json.Unmarshal(cache, fc); err != nil {
cached = cache
} else {
// No cache, fetch from Nominatim
buf := bufferpool.Get()
defer bufferpool.Put(buf)
// Create request
rb := requests.URL("https://nominatim.openstreetmap.org/reverse").Client(a.httpClient).ToBytesBuffer(buf)
// Set parameters
rb.Param("format", "geojson")
rb.Param("lat", fmt.Sprintf("%v", lat))
rb.Param("lon", fmt.Sprintf("%v", lon))
rb.Param("accept-language", lang+", en")
rb.Param("zoom", "14")
rb.Param("layer", "address")
// Do request
ctx, cancelFunc := context.WithTimeout(context.Background(), 3*time.Second)
defer cancelFunc()
if err := rb.Fetch(ctx); err != nil {
return nil, err
}
return fc, nil
}
// No cache, fetch from Photon
buf := bufferpool.Get()
defer bufferpool.Put(buf)
// Create request
rb := requests.URL("https://photon.komoot.io/reverse").Client(a.httpClient).ToBytesBuffer(buf)
// Set parameters
rb.Param("lat", fmt.Sprintf("%v", lat)).Param("lon", fmt.Sprintf("%v", lon))
rb.Param("lang", lo.If(slices.Contains([]string{"de", "fr", "it"}, lang), lang).Else("en"))
// Do request
ctx, cancelFunc := context.WithTimeout(context.Background(), 3*time.Second)
defer cancelFunc()
if err := rb.Fetch(ctx); err != nil {
return nil, err
cached = buf.Bytes()
// Cache response
_ = a.db.cachePersistently(key, cached)
}
// Unmarshal response
if err := json.Unmarshal(buf.Bytes(), fc); err != nil {
fc := geojson.NewFeatureCollection()
if err := json.Unmarshal(cached, fc); err != nil {
return nil, err
}
// Cache response
_ = a.db.cachePersistently(key, buf.Bytes())
return fc, nil
})
return fc, err
Expand Down
10 changes: 5 additions & 5 deletions geo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ func Test_geo(t *testing.T) {

assert.Equal(t, "52.5163, 13.3774", gt)

// Test original Photon request
fc.setFakeResponse(http.StatusOK, `{"features":[{"geometry":{"coordinates":[13.3774202,52.5162623],"type":"Point"},"type":"Feature","properties":{"osm_id":38345682,"osm_type":"W","extent":[13.3772052,52.5162623,13.3774202,52.5162476],"country":"Deutschland","osm_key":"highway","city":"Berlin","countrycode":"DE","district":"Mitte","osm_value":"service","postcode":"10117","name":"Platz des 18. März","type":"street"}}],"type":"FeatureCollection"}`)
// Test original Nominatim request
fc.setFakeResponse(http.StatusOK, `{"type":"FeatureCollection","licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright","features":[{"type":"Feature","properties":{"place_id":134066932,"osm_type":"relation","osm_id":1402158,"place_rank":21,"category":"boundary","type":"postal_code","importance":0.12008875486381318,"addresstype":"postcode","name":"10117","display_name":"10117, Mitte, Berlin, Deutschland","address":{"postcode":"10117","suburb":"Mitte","borough":"Mitte","city":"Berlin","ISO3166-2-lvl4":"DE-BE","country":"Deutschland","country_code":"de"}},"bbox":[13.3710363,52.5069995,13.4057347,52.5281501],"geometry":{"type": "Point","coordinates": [13.38776860055452, 52.5175184]}}]}`)

gt = app.geoTitle(gu, "de")

require.NotNil(t, fc.req)
assert.Equal(t, "https://photon.komoot.io/reverse?lang=de&lat=52.51627&lon=13.37737", fc.req.URL.String())
assert.Equal(t, "https://nominatim.openstreetmap.org/reverse?accept-language=de%2C+en&format=geojson&lat=52.51627&layer=address&lon=13.37737&zoom=14", fc.req.URL.String())

assert.Equal(t, "Berlin, Deutschland", gt)
assert.Equal(t, "Mitte, Berlin, Deutschland", gt)

// Test cache
fc.setFakeResponse(http.StatusOK, "")
Expand All @@ -59,6 +59,6 @@ func Test_geo(t *testing.T) {

assert.Nil(t, fc.req)

assert.Equal(t, "Berlin, Deutschland", gt)
assert.Equal(t, "Mitte, Berlin, Deutschland", gt)

}
20 changes: 10 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ require (
github.com/elnormous/contenttype v1.0.4
github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6
github.com/emersion/go-smtp v0.21.3
github.com/go-ap/activitypub v0.0.0-20240910141749-b4b8c8aa484c
github.com/go-ap/client v0.0.0-20241026132150-54b112a76f19
github.com/go-ap/activitypub v0.0.0-20241104140659-be99a725f9d5
github.com/go-ap/client v0.0.0-20241104140838-929b90e84e8a
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73
github.com/go-chi/chi/v5 v5.1.0
github.com/go-fed/httpsig v1.1.0
Expand Down Expand Up @@ -61,10 +61,10 @@ require (
github.com/yuin/goldmark v1.7.8
github.com/yuin/goldmark-emoji v1.0.4
go.hacdias.com/indielib v0.4.0
golang.org/x/crypto v0.28.0
golang.org/x/net v0.30.0
golang.org/x/sync v0.8.0
golang.org/x/text v0.19.0
golang.org/x/crypto v0.29.0
golang.org/x/net v0.31.0
golang.org/x/sync v0.9.0
golang.org/x/text v0.20.0
gopkg.in/yaml.v3 v3.0.1
maunium.net/go/mautrix v0.21.1
willnorris.com/go/microformats v1.2.1-0.20240301064101-b5d1b9d2120e
Expand Down Expand Up @@ -123,10 +123,10 @@ require (
github.com/x448/float16 v0.8.4 // indirect
go.mau.fi/util v0.8.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
golang.org/x/image v0.21.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
golang.org/x/image v0.22.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sys v0.27.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
willnorris.com/go/webmention v0.0.0-20220108183051-4a23794272f0 // indirect
)
44 changes: 22 additions & 22 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-ap/activitypub v0.0.0-20240910141749-b4b8c8aa484c h1:82lzmsy5Nr6JA6HcLRVxGfbdSoWfW45C6jnY3zFS7Ks=
github.com/go-ap/activitypub v0.0.0-20240910141749-b4b8c8aa484c/go.mod h1:rpIPGre4qtTgSpVT0zz3hycAMuLtUt7BNngVNpyXhL8=
github.com/go-ap/client v0.0.0-20241026132150-54b112a76f19 h1:/7X7Vn+OgFn5HKeIE4xyu2RfV0tFZYr9l7S30lZEiZ0=
github.com/go-ap/client v0.0.0-20241026132150-54b112a76f19/go.mod h1:Tb7nxNOwG4QK8jXseIqgvCSlt9EXyGMkIYgJc/B/6Tk=
github.com/go-ap/activitypub v0.0.0-20241104140659-be99a725f9d5 h1:TuHgI3hG3XQ78xHgFvCjlApZV32doA25F0sLwJNlcjU=
github.com/go-ap/activitypub v0.0.0-20241104140659-be99a725f9d5/go.mod h1:rpIPGre4qtTgSpVT0zz3hycAMuLtUt7BNngVNpyXhL8=
github.com/go-ap/client v0.0.0-20241104140838-929b90e84e8a h1:YROPlcBtCu/39itdbvbI5IuoIZvXcD1iBdZUuLcC9aI=
github.com/go-ap/client v0.0.0-20241104140838-929b90e84e8a/go.mod h1:Saq7b0oVyIeUCfdfNQ7g26FuMvmFN8yEFfdgDEWiwTU=
github.com/go-ap/errors v0.0.0-20240910140019-1e9d33cc1568 h1:eQEXAzWEijFbwtm/Hr2EtFbM0LvATRd1ltpDb+mfjQk=
github.com/go-ap/errors v0.0.0-20240910140019-1e9d33cc1568/go.mod h1:Vkh+Z3f24K8nMsJKXo1FHn5ebPsXvB/WDH5JRtYqdNo=
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73 h1:GMKIYXyXPGIp+hYiWOhfqK4A023HdgisDT4YGgf99mw=
Expand Down Expand Up @@ -303,12 +303,12 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s=
golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78=
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo=
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak=
golang.org/x/image v0.22.0 h1:UtK5yLUzilVrkjMAZAZ34DXGpASN8i8pj8g+O+yd10g=
golang.org/x/image v0.22.0/go.mod h1:9hPFhljd4zZ1GNSIZJ49sqbp45GKK9t6w+iXvGqZUz4=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All @@ -321,15 +321,15 @@ golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -342,22 +342,22 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU=
golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
Expand Down
2 changes: 1 addition & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
const (
contentType = "Content-Type"
userAgent = "User-Agent"
appUserAgent = "GoBlog"
appUserAgent = "GoBlog/1.0"

blogKey contextKey = "blog"
pathKey contextKey = "httpPath"
Expand Down

0 comments on commit 1c3c46c

Please sign in to comment.