Skip to content

Commit

Permalink
Merge pull request #39346 from elpaso/bugfix-server-wfs3-unreported-w…
Browse files Browse the repository at this point in the history
…rong-extension-handling-in-links

Bugfix server wfs3 unreported wrong extension handling in links
  • Loading branch information
elpaso committed Oct 13, 2020
2 parents ff7641d + 29055f1 commit a3d6965
Show file tree
Hide file tree
Showing 2 changed files with 409 additions and 204 deletions.
4 changes: 2 additions & 2 deletions src/server/qgsserverogcapihandler.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ std::string QgsServerOgcApiHandler::href( const QgsServerApiContext &context, co
} }


// Remove any existing extension // Remove any existing extension
const auto suffixLength { QFileInfo( url.path() ).completeSuffix().length() }; const auto suffixLength { QFileInfo( url.path() ).suffix().length() };
if ( suffixLength > 0 ) if ( suffixLength > 0 )
{ {
auto path {url.path()}; auto path {url.path()};
Expand Down Expand Up @@ -429,7 +429,7 @@ QgsServerOgcApi::ContentType QgsServerOgcApiHandler::contentTypeFromRequest( con
QgsServerOgcApi::ContentType result { defaultContentType() }; QgsServerOgcApi::ContentType result { defaultContentType() };
bool found { false }; bool found { false };
// First file extension ... // First file extension ...
const QString extension { QFileInfo( request->url().path() ).completeSuffix().toUpper() }; const QString extension { QFileInfo( request->url().path() ).suffix().toUpper() };
if ( ! extension.isEmpty() ) if ( ! extension.isEmpty() )
{ {
static QMetaEnum metaEnum { QMetaEnum::fromType<QgsServerOgcApi::ContentType>() }; static QMetaEnum metaEnum { QMetaEnum::fromType<QgsServerOgcApi::ContentType>() };
Expand Down
Loading

0 comments on commit a3d6965

Please sign in to comment.