Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] Do not cache invalid WM(T)S responses #5289

Merged
merged 2 commits into from
Oct 3, 2017

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented Oct 3, 2017

The problem here was that in case of http->https redirect
from a misconfigured server (that advertizes http and then
redirects all request to https) all http redirect requests
were cached, making all subsequent requests to the same
url hit the 301 Moved Permanently reponse page instead of
the redirected content.

Fixes #16427 WMTS rendering problems in 2.18 and Master

The problem here was that in case of http->https redirect
from a misconfigured server (that advertizes http and then
redirects all request to https) all http redirect requests
were cached, making all subsequent requests to the same
url hit the 301 Moved Permanently reponse page intead of
the redirected content.

Fixes qgis#16427 WMTS rendering problems in 2.18 and Master
@gioman
Copy link
Contributor

gioman commented Oct 3, 2017

@elpaso brillant!

@m-kuhn
Copy link
Member

m-kuhn commented Oct 3, 2017

Are these the white tiles that sometimes appear?

@elpaso
Copy link
Contributor Author

elpaso commented Oct 3, 2017

@m-kuhn I suppose yes, at least in this bug the unexpected behavior was the white tiles.

@m-kuhn
Copy link
Member

m-kuhn commented Oct 3, 2017

Lovely!

if ( ! image.isNull( ) )
{
sTileCache.insert( url, new QImage( image ) );
return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to make me even happier you define a return value on top and return it in the end.

bool success = false;

...

return success;

@elpaso elpaso merged commit 9256d00 into qgis:master Oct 3, 2017
@elpaso elpaso deleted the bugfix_16427 branch October 3, 2017 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants