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

For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response. #270

Closed
pclmnkenzo opened this issue Jul 15, 2024 · 14 comments

Comments

@pclmnkenzo
Copy link

For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response.

How can this be prevented this from happening?

@ahankinson
Copy link
Contributor

Do you have a URL or more information on what triggers this behaviour? It's hard to tell what the problem is from your description.

@pclmnkenzo
Copy link
Author

pclmnkenzo commented Jul 15, 2024 via email

@ahankinson
Copy link
Contributor

The ID is constructed from a couple different possible HTTP Headers. Here is the code where this happens:

https://github.com/ruven/iipsrv/blob/master/src/IIIF.cc#L195-L218

This looks like a configuration problem on your end.

The ID can come from the Host header from your proxy, which is what I suspect is happening. I'm going to guess that %%2 is a double-encoding of %20 (i.e., a space character) with some sort of string chomping that restricts it to only 3 characters. So somewhere there is an errant space being added to the Host header.

You can also use the X-IIIF-ID header to explicitly set the ID directly, which bypasses reading the Host header. You could try using that for debugging to see if the problem persists or if it goes away.

@ruven
Copy link
Owner

ruven commented Jul 15, 2024

Can you copy and paste the section from the iipsrv logfile where this happens? Make sure the verbosity parameter is set to something like 5. What configuration parameters are you using with iipsrv? Copy and paste also the beginning of the logfile which contains the startup parameters.

@pclmnkenzo
Copy link
Author

pclmnkenzo commented Jul 16, 2024 via email

@ruven
Copy link
Owner

ruven commented Jul 16, 2024

Are you using a HTTP_X_IIIF_ID header somewhere? I suspect that this is what is causing the problem.

And there's a lot of strange text in your log file. Is there some auto-formatting going on? Where did this <file: stuff come from in the log file?

IIIF :: URL decoded to \\10.76.136.69\DAMAssetsRW\5_16750_TIFF\MaltaLogo01.tif/info.json<file://10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif/info.json>

The following line tells you what is going to go in the ID field. Are you sure this is what you are really seeing in the log file?

IIIF :: ID is set to https://maltalibraries.inforlib.uk/iguana/iiif/image/\\\\10.76.136.69\\DAMAssetsRW\\5_16750_TIFF\\MaltaLogo01.tif%%2<https://maltalibraries.inforlib.uk/iguana/iiif/image/10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif%25%252>

@pclmnkenzo
Copy link
Author

pclmnkenzo commented Jul 17, 2024 via email

@pclmnkenzo
Copy link
Author

iipsrv.log
Attaching the log file also

@ruven
Copy link
Owner

ruven commented Jul 17, 2024

I'm unable to reproduce this. Could you give me some more info on your setup:

  1. Are you using the official 1.2 release?
  2. What OS are you running this on?
  3. What web server are you using in front of iipsrv
  4. How are you starting iipsrv?

@pclmnkenzo
Copy link
Author

pclmnkenzo commented Jul 18, 2024 via email

@ruven
Copy link
Owner

ruven commented Jul 18, 2024

Question: is the official 1.2 release that came out after August 2023 compatible with Windows server 2019 and higher?

Yes it should be. I suggest you try with the official 1.2 release to see if that makes a difference - it's built using the same instructions you link to. If you find it's not compatible, try building from the latest source code.

The result worked fine at another site.

Are there any differences between the setups at this other site?

@pclmnkenzo
Copy link
Author

pclmnkenzo commented Aug 26, 2024 via email

@ruven ruven closed this as completed in 0b9b301 Sep 6, 2024
@ruven
Copy link
Owner

ruven commented Sep 6, 2024

Technically, slashes that are part of the IIIF syntax itself should not be URL-escaped in this way (see section 9 of the API docs: https://iiif.io/api/image/3.0/#9-uri-encoding-and-decoding).

Nevertheless, I've just pushed a fix for this here: 0b9b301

Let me know if this resolves your problem.

@pclmnkenzo
Copy link
Author

pclmnkenzo commented Sep 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants