File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change
1
+ 06/09/2024:
2
+ - Added extra URL decoding to ID field for IIIF's info.json. Fixes https://github.com/ruven/iipsrv/issues/270
3
+
4
+
1
5
05/09/2024:
2
6
- Added convenience function to Rawtile class to duplicate bands for encoders that cannot natively handle
3
7
single band monochrome images: simplifies WebP encoding.
Original file line number Diff line number Diff line change @@ -206,11 +206,16 @@ void IIIF::run( Session* session, const string& src )
206
206
string scheme = session->headers [" HTTPS" ].empty () ? " http://" : " https://" ;
207
207
208
208
if (request_uri.empty ()){
209
- throw invalid_argument ( " IIIF: REQUEST_URI was not set in FastCGI request, so the ID parameter cannot be set. " );
209
+ throw invalid_argument ( " IIIF: REQUEST_URI was not set in FastCGI request, so the ID parameter cannot be set" );
210
210
}
211
211
212
- request_uri.erase ( request_uri.length () - suffix.length () - 1 , string::npos );
213
- id = scheme + session->headers [" HTTP_HOST" ] + request_uri;
212
+ // Need to decode in case URL is encoded
213
+ URL uri ( request_uri );
214
+ string decoded_uri = uri.decode ();
215
+
216
+ // Remove the suffix and the preceding "/"
217
+ decoded_uri.erase ( decoded_uri.length () - suffix.length () - 1 , string::npos );
218
+ id = scheme + session->headers [" HTTP_HOST" ] + decoded_uri;
214
219
}
215
220
216
221
// Decode and escape any URL-encoded characters from our file name for JSON
You can’t perform that action at this time.
0 commit comments