Modify

Opened 9 months ago

Closed 9 months ago

Last modified 8 months ago

#24237 closed enhancement (worksforme)

Add ability to include cookie headers in imagery requests

Reported by: cigazze Owned by: team
Priority: normal Milestone:
Component: Core imagery Version:
Keywords: cookie Cc:

Description

Strava has recently made a change to their global heatmap tiles that (as of now) requires certain cookies to be provided as part of the Cookie header, instead of query params. This is currently impossible with JOSM.

Some way to provide cookies for JOSM to include in an imagery source's requests would help solve this issue.

Attachments (0)

Change History (8)

comment:1 by stoecker, 9 months ago

Resolution: worksforme
Status: newclosed

RTFM: Maps:
custom-http-header - HTTP headers to be sent to server (replacement of {header(header, value)}). It has two attributes header-name and header-value. Might be specified multiple times.

comment:2 by cigazze, 9 months ago

That seems to specifically apply to the XML at josm.openstreetmap.de/maps, not imagery sources added manually through the UI. There's not currently any way to do this with the UI, and it's not documented how to add these cookies manually (to the preferences.xml or wherever else this is supposed to be done.) The remote XML isn't really relevant here since these are authentication cookies that are user-specific and refresh regularly.

comment:3 by stoecker, 9 months ago

Again: Read before writing: Maps. Especially sentence 2: The URL can be customized in the advanced preferences (key imagery.layers.sites). Using multiple sources at the same time is possible.

If you have special requirements, then you must use the XML format to supply the information (can be a local file). There will be no interface for that stuff.

comment:4 by cigazze, 9 months ago

I read that. The detail that you can put in the path a local file there is not documented, nor included in the section that you linked, and I would never have guessed that was the case until you wrote that in your reply. Thanks for that detail. The documentation could probably be improved to better explain how custom imagery sources can be added locally. (I still don't even know what format the file is meant to go in as -- a file:// URI or a plain path? -- but I'll try both.)

I also don't know what I did wrong here, nor what I did to warrant the condescension and hostility I've been provided. I pored over that entire page yesterday trying to work out how to make this work, and I don't think I'm an idiot for not having known a crucial detail that's completely undocumented. My goal with this ticket was to simply suggest a feature that would be nice for some use cases, and all of my communication here has been polite and in good faith. I don't think that warrants being told to "read the fucking manual" and "again: read before writing" as if I'm a willful idiot who's refusing to follow directions. I'm not sure what else I was supposed to do, besides learn how to read minds over the internet.

comment:5 by anonymous, 9 months ago

With JOSM closed, edit preferences.xml.

In the

<maps key='imagery.entries'>

section, add an entry like this:

    <map>
      <tag key='max-zoom' value='15'/>
      <tag key='transparent' value='true'/>
      <tag key='minimumTileExpire' value='3600'/>
      <tag key='name' value='Strava'/>
      <tag key='type' value='tms'/>
      <tag key='url' value='https://content-a.strava.com/identified/globalheat/all/blue/{zoom}/{x}/{y}.png?v=19'/>
      <tag key='cookies' value='iterableEndUserId=xxx;_strava4_session=xxx;CloudFront-Key-Pair-Id=xxx;CloudFront-Policy=xxx;CloudFront-Signature=xxx;_strava_idcf=xxx;_strava_CloudFront-Expires=xxx'/>
      <tag key='customHttpHeaders' value='{}'/>
    </map>

Replace "xxx" with the appropriate values from your Strava browser session.

comment:6 by highland, 8 months ago

I'm still at a loss as to how to get back my Strava Global Heatmap as an imagery layer (and am hesitant to ask after the exchanges above).
In the past, all I had to do was go to imagery preferences in JOSM and paste in the current Imagery URL from viewing Strava's Heatmap with my login. This has worked for ages, but now doesn't.
I don't see a preferences XML file and hesitate to make one.
Can we have some sympathetic help?

in reply to:  6 comment:7 by Timmy_Tesseract, 8 months ago

Replying to highland:

I'm still at a loss as to how to get back my Strava Global Heatmap as an imagery layer (and am hesitant to ask after the exchanges above).
In the past, all I had to do was go to imagery preferences in JOSM and paste in the current Imagery URL from viewing Strava's Heatmap with my login. This has worked for ages, but now doesn't.
I don't see a preferences XML file and hesitate to make one.
Can we have some sympathetic help?

This tms url still works (no strava login required):
tms[15]:https://strava-heatmap.tiles.freemap.sk/all/hot/{zoom}/{x}/{y}.png?px=512

comment:8 by highland, 8 months ago

Oh bless you!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.