Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
are replaced with proxy endpoint URLs and the original S3 URLs are preserved in
`alternate.s3.href` using the Alternate Assets Extension.

### Fixed

- When using the `_filter` parameter, the combined filter was returned in the `next` link
body. This had the correct semantics, but the size of the filter would grow by one
`and` nesting each pagination request, as the `_filter` was repeatedly added to body.

## [4.4.0] - 2025-09-10

## Changed
Expand Down
159 changes: 85 additions & 74 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions src/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,10 @@ const wrapResponseInFeatureCollection = function (features, links,
return fc
}

const buildPaginationLinks = function (limit, parameters, bbox, intersects, collections, endpoint,
httpMethod, sortby, items) {
const buildPaginationLinks = function (
limit, parameters, bbox, intersects, collections, filter,
endpoint, httpMethod, sortby, items
) {
if (items.length) {
const dictToURI = (dict) => (
Object.keys(dict).map(
Expand Down Expand Up @@ -620,7 +622,9 @@ const buildPaginationLinks = function (limit, parameters, bbox, intersects, coll
method: httpMethod,
type: 'application/geo+json'
}
const nextParams = pickBy(assign(parameters, { bbox, intersects, limit, next, collections }))
const nextParams = pickBy(
assign(parameters, { bbox, intersects, limit, next, collections, filter })
)
if (httpMethod === 'GET') {
const nextQueryParameters = dictToURI(nextParams)
link.href = `${endpoint}?${nextQueryParameters}`
Expand Down Expand Up @@ -655,8 +659,10 @@ const searchItems = async function (

const sortby = extractSortby(parameters)
const query = extractStacQuery(parameters)
const filter = concatenateCql2Filters(
extractCql2Filter(parameters),
const specifiedFilter = extractCql2Filter(parameters)

const combinedFilter = concatenateCql2Filters(
specifiedFilter,
extractRestrictionCql2Filter(parameters, headers)
)
const fields = extractFields(parameters)
Expand All @@ -674,7 +680,7 @@ const searchItems = async function (
datetime,
intersects: geometry,
query,
filter: filter,
filter: combinedFilter,
sortby,
fields,
ids,
Expand Down Expand Up @@ -730,6 +736,7 @@ const searchItems = async function (
bbox,
intersects,
specifiedCollectionIds,
specifiedFilter,
newEndpoint,
httpMethod,
sortby,
Expand Down
Loading