Template talk:Cospar

Changing the id URL to an up-to-date HTTPS URL
From what it appears, the current URL in the template generates a sequence of two HTTP 301 redirects that lead to the actual page. For example, http://nssdc.gsfc.nasa.gov/nmc/spacecraftDisplay.do?id=1958-008A generates a 301 redirect to https://nssdc.gsfc.nasa.gov/nmc/spacecraftDisplay.do?id=1958-008A which generates another 301 redirect to the actual page at https://nssdc.gsfc.nasa.gov/nmc/spacecraft/display.action?id=1958-008A. In addition, for a number of URLs that I tested, it appears that the HTTP response headers from the second 301 redirect and the actual page include a Strict-transport-security header with a value of. This would seem to indicate that changing existing HTTP URLs to HTTPS URLs should not be too much of an issue, if any. As of now, I have edited the template sandbox to use the final HTTPS URL for the id link.

I have also edited the template testcases page to include two testcases where there is a NSSDCA (NASA Space Science Data Coordinated Archive) id that consists entirely of letters, with no dashes. Examples of these NSSDCA IDs are PIONX for Pioneer P-3, PIONY for Pioneer P-30, and PIONZ for Pioneer P-31. These three IDs appear to generate the pattern of 301 redirects described previously. (Of possible note, on this Mars Society Australia page, there is a URL http://nssdc.gsfc.nasa.gov/nmc/spacecraftDisplay.do?id=MAVEN. Visiting that URL in a browser leads to an error page at the NSSDCA site.) The testcases on the template testcases page appear to work all right.

From this, it would seem useful to edit the actual template to use the HTTPS URL  instead of the current URL. Such a change would reduce the number of redirects and would provide increased privacy and security for users. Thoughts? --Elegie (talk) 08:40, 4 April 2019 (UTC)

Template-protected edit request on 8 April 2020
asked me if it would be possible to validate the COSPAR IDs passed to this template. In the template sandbox, I have added validation that will display an error when the ID is not in the format. If there is no dash in the ID, it is assumed to be an alternate format and validation is skipped. Otherwise, the ID is checked for four characters at the start that are a year between 1957 and the current year inclusive, then a dash, then 3 digits, and then 1-3 letters. There are testcases that show the effect of the validation. When an error is displayed, the page will also be added to Category:Pages with COSPAR ID errors, which I will create after the changes are merged. AntiCompositeNumber (talk) 23:06, 8 April 2020 (UTC)
 * ✅.  P.I. Ellsworth   ed.  put'r there 14:45, 9 April 2020 (UTC)

COSPAR ID with 2 items situation needs URL links
COSPAR ID with single item could generate URL link, like Mariner 4. But how about two items situations (Apollo 13 and Mars 2)? $ g(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2 } $ 21:34, 17 December 2020 (UTC)